Merge pull request #14126 from mapbox/gfx-refactor-4

Graphics refactor #4
This commit is contained in:
Konstantin Käfer
2019-03-15 20:31:12 +01:00
committed by GitHub
parent 62695c5695
commit c8cfdb1ced
156 changed files with 2486 additions and 2573 deletions

View File

@@ -3,7 +3,7 @@
require('flow-remove-types/register');
const path = require('path');
const outputPath = 'src/mbgl/shaders';
const outputPath = 'src/mbgl/programs/gl';
const zlib = require('zlib');
var shaders = require('../mapbox-gl-js/src/shaders');
@@ -31,52 +31,82 @@ for (const key in shaders) {
concatenated += basicMinify(shaders[key].fragmentSource);
concatenated += '\n\0';
offsets[key] = {vertex, fragment};
offsets[key] = {
vertex,
fragment,
originalKey: key,
shaderName: key.replace(/[A-Z]+/g, (match) => `_${match.toLowerCase()}`),
ShaderName: key.replace(/^[a-z]/g, (match) => match.toUpperCase())
};
}
// Overrides: The symbolSDF shader is used for two underlying programs.
offsets.symbolSDFIcon = {
vertex: offsets.symbolSDF.vertex,
fragment: offsets.symbolSDF.fragment,
originalKey: 'symbolSDF',
shaderName: 'symbol_sdf_icon',
ShaderName: 'SymbolSDFIcon',
};
offsets.symbolSDFText = {
vertex: offsets.symbolSDF.vertex,
fragment: offsets.symbolSDF.fragment,
originalKey: 'symbolSDF',
shaderName: 'symbol_sdf_text',
ShaderName: 'SymbolSDFText',
};
delete offsets.symbolSDF;
const compressed = zlib.deflateSync(concatenated, {level: zlib.Z_BEST_COMPRESSION})
.toString('hex')
.match(/.{1,16}/g)
.match(/.{1,32}/g)
.map(line => line.match(/.{1,2}/g).map(n => `0x${n}`).join(', '))
.join(',\n ')
.join(',\n ')
.trim();
function sourceOffset(key, type) {
return `source() + ${offsets[key][type]}`
return `programs::gl::shaderSource() + ${offsets[key][type]}`
}
writeIfModified(path.join(outputPath, 'source.hpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
writeIfModified(path.join(outputPath, 'shader_source.hpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#pragma once
namespace mbgl {
namespace shaders {
namespace programs {
namespace gl {
const char* source();
const char* shaderSource();
} // namespace shaders
} // namespace gl
} // namespace programs
} // namespace mbgl
`);
writeIfModified(path.join(outputPath, 'source.cpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
writeIfModified(path.join(outputPath, 'shader_source.cpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/util/compression.hpp>
#include <cstdint>
namespace mbgl {
namespace shaders {
namespace programs {
namespace gl {
const char* source() {
static const uint8_t compressed[] = {
${compressed}
};
static std::string decompressed = util::decompress(std::string(reinterpret_cast<const char*>(compressed), sizeof(compressed)));
constexpr const uint8_t compressedShaderSource[] = {
${compressed}
};
const char* shaderSource() {
static std::string decompressed = util::decompress(std::string(reinterpret_cast<const char*>(compressedShaderSource), sizeof(compressedShaderSource)));
return decompressed.c_str();
};
} // namespace shaders
} // namespace gl
} // namespace programs
} // namespace mbgl
`);
@@ -85,77 +115,69 @@ writeIfModified(path.join(outputPath, 'preludes.hpp'), `// NOTE: DO NOT CHANGE T
#pragma once
namespace mbgl {
namespace shaders {
namespace programs {
namespace gl {
extern const char* vertexPrelude;
extern const char* fragmentPrelude;
extern const char* vertexShaderPrelude;
extern const char* fragmentShaderPrelude;
} // namespace shaders
} // namespace gl
} // namespace programs
} // namespace mbgl
`);
writeIfModified(path.join(outputPath, 'preludes.cpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/preludes.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/gl/preludes.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
namespace mbgl {
namespace shaders {
namespace programs {
namespace gl {
const char* vertexPrelude = ${sourceOffset('prelude', 'vertex')};
const char* fragmentPrelude = ${sourceOffset('prelude', 'fragment')};
const char* vertexShaderPrelude = ${sourceOffset('prelude', 'vertex')};
const char* fragmentShaderPrelude = ${sourceOffset('prelude', 'fragment')};
} // namespace shaders
} // namespace gl
} // namespace programs
} // namespace mbgl
`);
for (const key in shaders) {
for (const key in offsets) {
if (key === 'prelude')
continue;
const shaderName = key.replace(/[A-Z]+/g, (match) => `_${match.toLowerCase()}`);
writeIfModified(path.join(outputPath, `${shaderName}.hpp`), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#pragma once
namespace mbgl {
namespace shaders {
class ${shaderName} {
public:
static const char* name;
static const char* vertexSource;
static const char* fragmentSource;
};
} // namespace shaders
} // namespace mbgl
`);
const { shaderName, ShaderName, originalKey } = offsets[key];
writeIfModified(path.join(outputPath, `${shaderName}.cpp`), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/${shaderName}.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/${shaderName}_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* ${shaderName}::name = "${shaderName}";
const char* ${shaderName}::vertexSource = ${sourceOffset(key, 'vertex')};
const char* ${shaderName}::fragmentSource = ${sourceOffset(key, 'fragment')};
template <>
std::unique_ptr<Program<${ShaderName}Program>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<${ShaderName}Program>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "${shaderName}",
${sourceOffset(key, 'vertex')}, ${sourceOffset(key, 'fragment')});
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of ${shaderName}.vertex.glsl:
/*
${shaders[key].vertexSource}
${shaders[originalKey].vertexSource}
*/
// Uncompressed source of ${shaderName}.fragment.glsl:
/*
${shaders[key].fragmentSource}
${shaders[originalKey].fragmentSource}
*/
} // namespace shaders
} // namespace mbgl
`);
}

View File

@@ -16,7 +16,9 @@
"src/mbgl/geometry/dem_data.cpp",
"src/mbgl/geometry/feature_index.cpp",
"src/mbgl/geometry/line_atlas.cpp",
"src/mbgl/gfx/attribute.cpp",
"src/mbgl/gl/attribute.cpp",
"src/mbgl/gl/binary_program.cpp",
"src/mbgl/gl/context.cpp",
"src/mbgl/gl/debugging.cpp",
"src/mbgl/gl/debugging_extension.cpp",
@@ -51,12 +53,42 @@
"src/mbgl/math/log2.cpp",
"src/mbgl/platform/gl_functions.cpp",
"src/mbgl/programs/background_program.cpp",
"src/mbgl/programs/binary_program.cpp",
"src/mbgl/programs/circle_program.cpp",
"src/mbgl/programs/clipping_mask_program.cpp",
"src/mbgl/programs/collision_box_program.cpp",
"src/mbgl/programs/debug_program.cpp",
"src/mbgl/programs/extrusion_texture_program.cpp",
"src/mbgl/programs/fill_extrusion_program.cpp",
"src/mbgl/programs/fill_program.cpp",
"src/mbgl/programs/gl/background.cpp",
"src/mbgl/programs/gl/background_pattern.cpp",
"src/mbgl/programs/gl/circle.cpp",
"src/mbgl/programs/gl/clipping_mask.cpp",
"src/mbgl/programs/gl/collision_box.cpp",
"src/mbgl/programs/gl/collision_circle.cpp",
"src/mbgl/programs/gl/debug.cpp",
"src/mbgl/programs/gl/extrusion_texture.cpp",
"src/mbgl/programs/gl/fill.cpp",
"src/mbgl/programs/gl/fill_extrusion.cpp",
"src/mbgl/programs/gl/fill_extrusion_pattern.cpp",
"src/mbgl/programs/gl/fill_outline.cpp",
"src/mbgl/programs/gl/fill_outline_pattern.cpp",
"src/mbgl/programs/gl/fill_pattern.cpp",
"src/mbgl/programs/gl/heatmap.cpp",
"src/mbgl/programs/gl/heatmap_texture.cpp",
"src/mbgl/programs/gl/hillshade.cpp",
"src/mbgl/programs/gl/hillshade_prepare.cpp",
"src/mbgl/programs/gl/line.cpp",
"src/mbgl/programs/gl/line_gradient.cpp",
"src/mbgl/programs/gl/line_pattern.cpp",
"src/mbgl/programs/gl/line_sdf.cpp",
"src/mbgl/programs/gl/preludes.cpp",
"src/mbgl/programs/gl/raster.cpp",
"src/mbgl/programs/gl/shader_source.cpp",
"src/mbgl/programs/gl/shaders.cpp",
"src/mbgl/programs/gl/symbol_icon.cpp",
"src/mbgl/programs/gl/symbol_sdf_icon.cpp",
"src/mbgl/programs/gl/symbol_sdf_text.cpp",
"src/mbgl/programs/heatmap_program.cpp",
"src/mbgl/programs/heatmap_texture_program.cpp",
"src/mbgl/programs/hillshade_prepare_program.cpp",
@@ -109,34 +141,6 @@
"src/mbgl/renderer/sources/render_vector_source.cpp",
"src/mbgl/renderer/style_diff.cpp",
"src/mbgl/renderer/tile_pyramid.cpp",
"src/mbgl/shaders/background.cpp",
"src/mbgl/shaders/background_pattern.cpp",
"src/mbgl/shaders/circle.cpp",
"src/mbgl/shaders/clipping_mask.cpp",
"src/mbgl/shaders/collision_box.cpp",
"src/mbgl/shaders/collision_circle.cpp",
"src/mbgl/shaders/debug.cpp",
"src/mbgl/shaders/extrusion_texture.cpp",
"src/mbgl/shaders/fill.cpp",
"src/mbgl/shaders/fill_extrusion.cpp",
"src/mbgl/shaders/fill_extrusion_pattern.cpp",
"src/mbgl/shaders/fill_outline.cpp",
"src/mbgl/shaders/fill_outline_pattern.cpp",
"src/mbgl/shaders/fill_pattern.cpp",
"src/mbgl/shaders/heatmap.cpp",
"src/mbgl/shaders/heatmap_texture.cpp",
"src/mbgl/shaders/hillshade.cpp",
"src/mbgl/shaders/hillshade_prepare.cpp",
"src/mbgl/shaders/line.cpp",
"src/mbgl/shaders/line_gradient.cpp",
"src/mbgl/shaders/line_pattern.cpp",
"src/mbgl/shaders/line_sdf.cpp",
"src/mbgl/shaders/preludes.cpp",
"src/mbgl/shaders/raster.cpp",
"src/mbgl/shaders/shaders.cpp",
"src/mbgl/shaders/source.cpp",
"src/mbgl/shaders/symbol_icon.cpp",
"src/mbgl/shaders/symbol_sdf.cpp",
"src/mbgl/sprite/sprite_loader.cpp",
"src/mbgl/sprite/sprite_loader_worker.cpp",
"src/mbgl/sprite/sprite_parser.cpp",
@@ -505,12 +509,14 @@
"mbgl/gfx/attribute.hpp": "src/mbgl/gfx/attribute.hpp",
"mbgl/gfx/color_mode.hpp": "src/mbgl/gfx/color_mode.hpp",
"mbgl/gfx/context.hpp": "src/mbgl/gfx/context.hpp",
"mbgl/gfx/context_impl.hpp": "src/mbgl/gfx/context_impl.hpp",
"mbgl/gfx/cull_face_mode.hpp": "src/mbgl/gfx/cull_face_mode.hpp",
"mbgl/gfx/depth_mode.hpp": "src/mbgl/gfx/depth_mode.hpp",
"mbgl/gfx/draw_mode.hpp": "src/mbgl/gfx/draw_mode.hpp",
"mbgl/gfx/draw_scope.hpp": "src/mbgl/gfx/draw_scope.hpp",
"mbgl/gfx/index_buffer.hpp": "src/mbgl/gfx/index_buffer.hpp",
"mbgl/gfx/index_vector.hpp": "src/mbgl/gfx/index_vector.hpp",
"mbgl/gfx/primitives.hpp": "src/mbgl/gfx/primitives.hpp",
"mbgl/gfx/program.hpp": "src/mbgl/gfx/program.hpp",
"mbgl/gfx/stencil_mode.hpp": "src/mbgl/gfx/stencil_mode.hpp",
"mbgl/gfx/texture.hpp": "src/mbgl/gfx/texture.hpp",
"mbgl/gfx/types.hpp": "src/mbgl/gfx/types.hpp",
@@ -518,10 +524,12 @@
"mbgl/gfx/vertex_buffer.hpp": "src/mbgl/gfx/vertex_buffer.hpp",
"mbgl/gfx/vertex_vector.hpp": "src/mbgl/gfx/vertex_vector.hpp",
"mbgl/gl/attribute.hpp": "src/mbgl/gl/attribute.hpp",
"mbgl/gl/binary_program.hpp": "src/mbgl/gl/binary_program.hpp",
"mbgl/gl/context.hpp": "src/mbgl/gl/context.hpp",
"mbgl/gl/debugging.hpp": "src/mbgl/gl/debugging.hpp",
"mbgl/gl/debugging_extension.hpp": "src/mbgl/gl/debugging_extension.hpp",
"mbgl/gl/defines.hpp": "src/mbgl/gl/defines.hpp",
"mbgl/gl/draw_scope_resource.hpp": "src/mbgl/gl/draw_scope_resource.hpp",
"mbgl/gl/enum.hpp": "src/mbgl/gl/enum.hpp",
"mbgl/gl/extension.hpp": "src/mbgl/gl/extension.hpp",
"mbgl/gl/features.hpp": "src/mbgl/gl/features.hpp",
@@ -553,26 +561,40 @@
"mbgl/map/transform_state.hpp": "src/mbgl/map/transform_state.hpp",
"mbgl/map/zoom_history.hpp": "src/mbgl/map/zoom_history.hpp",
"mbgl/programs/attributes.hpp": "src/mbgl/programs/attributes.hpp",
"mbgl/programs/background_pattern_program.hpp": "src/mbgl/programs/background_pattern_program.hpp",
"mbgl/programs/background_program.hpp": "src/mbgl/programs/background_program.hpp",
"mbgl/programs/binary_program.hpp": "src/mbgl/programs/binary_program.hpp",
"mbgl/programs/circle_program.hpp": "src/mbgl/programs/circle_program.hpp",
"mbgl/programs/clipping_mask_program.hpp": "src/mbgl/programs/clipping_mask_program.hpp",
"mbgl/programs/collision_box_program.hpp": "src/mbgl/programs/collision_box_program.hpp",
"mbgl/programs/collision_circle_program.hpp": "src/mbgl/programs/collision_circle_program.hpp",
"mbgl/programs/debug_program.hpp": "src/mbgl/programs/debug_program.hpp",
"mbgl/programs/extrusion_texture_program.hpp": "src/mbgl/programs/extrusion_texture_program.hpp",
"mbgl/programs/fill_extrusion_pattern_program.hpp": "src/mbgl/programs/fill_extrusion_pattern_program.hpp",
"mbgl/programs/fill_extrusion_program.hpp": "src/mbgl/programs/fill_extrusion_program.hpp",
"mbgl/programs/fill_outline_pattern_program.hpp": "src/mbgl/programs/fill_outline_pattern_program.hpp",
"mbgl/programs/fill_outline_program.hpp": "src/mbgl/programs/fill_outline_program.hpp",
"mbgl/programs/fill_pattern_program.hpp": "src/mbgl/programs/fill_pattern_program.hpp",
"mbgl/programs/fill_program.hpp": "src/mbgl/programs/fill_program.hpp",
"mbgl/programs/gl/preludes.hpp": "src/mbgl/programs/gl/preludes.hpp",
"mbgl/programs/gl/shader_source.hpp": "src/mbgl/programs/gl/shader_source.hpp",
"mbgl/programs/gl/shaders.hpp": "src/mbgl/programs/gl/shaders.hpp",
"mbgl/programs/heatmap_program.hpp": "src/mbgl/programs/heatmap_program.hpp",
"mbgl/programs/heatmap_texture_program.hpp": "src/mbgl/programs/heatmap_texture_program.hpp",
"mbgl/programs/hillshade_prepare_program.hpp": "src/mbgl/programs/hillshade_prepare_program.hpp",
"mbgl/programs/hillshade_program.hpp": "src/mbgl/programs/hillshade_program.hpp",
"mbgl/programs/line_gradient_program.hpp": "src/mbgl/programs/line_gradient_program.hpp",
"mbgl/programs/line_pattern_program.hpp": "src/mbgl/programs/line_pattern_program.hpp",
"mbgl/programs/line_program.hpp": "src/mbgl/programs/line_program.hpp",
"mbgl/programs/line_sdf_program.hpp": "src/mbgl/programs/line_sdf_program.hpp",
"mbgl/programs/program.hpp": "src/mbgl/programs/program.hpp",
"mbgl/programs/program_parameters.hpp": "src/mbgl/programs/program_parameters.hpp",
"mbgl/programs/programs.hpp": "src/mbgl/programs/programs.hpp",
"mbgl/programs/raster_program.hpp": "src/mbgl/programs/raster_program.hpp",
"mbgl/programs/segment.hpp": "src/mbgl/programs/segment.hpp",
"mbgl/programs/symbol_icon_program.hpp": "src/mbgl/programs/symbol_icon_program.hpp",
"mbgl/programs/symbol_program.hpp": "src/mbgl/programs/symbol_program.hpp",
"mbgl/programs/symbol_sdf_icon_program.hpp": "src/mbgl/programs/symbol_sdf_icon_program.hpp",
"mbgl/programs/symbol_sdf_text_program.hpp": "src/mbgl/programs/symbol_sdf_text_program.hpp",
"mbgl/programs/textures.hpp": "src/mbgl/programs/textures.hpp",
"mbgl/programs/uniforms.hpp": "src/mbgl/programs/uniforms.hpp",
"mbgl/renderer/bucket.hpp": "src/mbgl/renderer/bucket.hpp",
@@ -628,34 +650,6 @@
"mbgl/renderer/tile_pyramid.hpp": "src/mbgl/renderer/tile_pyramid.hpp",
"mbgl/renderer/transition_parameters.hpp": "src/mbgl/renderer/transition_parameters.hpp",
"mbgl/renderer/update_parameters.hpp": "src/mbgl/renderer/update_parameters.hpp",
"mbgl/shaders/background.hpp": "src/mbgl/shaders/background.hpp",
"mbgl/shaders/background_pattern.hpp": "src/mbgl/shaders/background_pattern.hpp",
"mbgl/shaders/circle.hpp": "src/mbgl/shaders/circle.hpp",
"mbgl/shaders/clipping_mask.hpp": "src/mbgl/shaders/clipping_mask.hpp",
"mbgl/shaders/collision_box.hpp": "src/mbgl/shaders/collision_box.hpp",
"mbgl/shaders/collision_circle.hpp": "src/mbgl/shaders/collision_circle.hpp",
"mbgl/shaders/debug.hpp": "src/mbgl/shaders/debug.hpp",
"mbgl/shaders/extrusion_texture.hpp": "src/mbgl/shaders/extrusion_texture.hpp",
"mbgl/shaders/fill.hpp": "src/mbgl/shaders/fill.hpp",
"mbgl/shaders/fill_extrusion.hpp": "src/mbgl/shaders/fill_extrusion.hpp",
"mbgl/shaders/fill_extrusion_pattern.hpp": "src/mbgl/shaders/fill_extrusion_pattern.hpp",
"mbgl/shaders/fill_outline.hpp": "src/mbgl/shaders/fill_outline.hpp",
"mbgl/shaders/fill_outline_pattern.hpp": "src/mbgl/shaders/fill_outline_pattern.hpp",
"mbgl/shaders/fill_pattern.hpp": "src/mbgl/shaders/fill_pattern.hpp",
"mbgl/shaders/heatmap.hpp": "src/mbgl/shaders/heatmap.hpp",
"mbgl/shaders/heatmap_texture.hpp": "src/mbgl/shaders/heatmap_texture.hpp",
"mbgl/shaders/hillshade.hpp": "src/mbgl/shaders/hillshade.hpp",
"mbgl/shaders/hillshade_prepare.hpp": "src/mbgl/shaders/hillshade_prepare.hpp",
"mbgl/shaders/line.hpp": "src/mbgl/shaders/line.hpp",
"mbgl/shaders/line_gradient.hpp": "src/mbgl/shaders/line_gradient.hpp",
"mbgl/shaders/line_pattern.hpp": "src/mbgl/shaders/line_pattern.hpp",
"mbgl/shaders/line_sdf.hpp": "src/mbgl/shaders/line_sdf.hpp",
"mbgl/shaders/preludes.hpp": "src/mbgl/shaders/preludes.hpp",
"mbgl/shaders/raster.hpp": "src/mbgl/shaders/raster.hpp",
"mbgl/shaders/shaders.hpp": "src/mbgl/shaders/shaders.hpp",
"mbgl/shaders/source.hpp": "src/mbgl/shaders/source.hpp",
"mbgl/shaders/symbol_icon.hpp": "src/mbgl/shaders/symbol_icon.hpp",
"mbgl/shaders/symbol_sdf.hpp": "src/mbgl/shaders/symbol_sdf.hpp",
"mbgl/sprite/sprite_loader.hpp": "src/mbgl/sprite/sprite_loader.hpp",
"mbgl/sprite/sprite_loader_observer.hpp": "src/mbgl/sprite/sprite_loader_observer.hpp",
"mbgl/sprite/sprite_loader_worker.hpp": "src/mbgl/sprite/sprite_loader_worker.hpp",

View File

@@ -0,0 +1,21 @@
#include <mbgl/gfx/attribute.hpp>
#include <limits>
#include <cassert>
namespace mbgl {
namespace gfx {
optional<AttributeBinding> offsetAttributeBinding(const optional<AttributeBinding>& binding, std::size_t vertexOffset) {
assert(vertexOffset <= std::numeric_limits<uint32_t>::max());
if (binding) {
AttributeBinding result = *binding;
result.vertexOffset = static_cast<uint32_t>(vertexOffset);
return result;
} else {
return binding;
}
}
} // namespace gfx
} // namespace mbgl

View File

@@ -1,8 +1,11 @@
#pragma once
#include <mbgl/gfx/types.hpp>
#include <mbgl/gfx/vertex_buffer.hpp>
#include <mbgl/util/type_list.hpp>
#include <mbgl/util/indexed_tuple.hpp>
#include <mbgl/util/ignore.hpp>
#include <mbgl/util/optional.hpp>
#include <array>
#include <type_traits>
@@ -79,6 +82,21 @@ struct VertexDescriptor {
AttributeDescriptor attributes[5];
};
class AttributeBinding {
public:
AttributeDescriptor attribute;
uint8_t vertexStride;
const VertexBufferResource* vertexBufferResource;
uint32_t vertexOffset;
friend bool operator==(const AttributeBinding& lhs, const AttributeBinding& rhs) {
return lhs.attribute == rhs.attribute &&
lhs.vertexStride == rhs.vertexStride &&
lhs.vertexBufferResource == rhs.vertexBufferResource &&
lhs.vertexOffset == rhs.vertexOffset;
}
};
// Attribute binding requires member offsets. The only standard way to
// obtain an offset is the offsetof macro. The offsetof macro has defined
// behavior only for standard layout types. That rules out std::tuple and
@@ -89,32 +107,32 @@ struct VertexDescriptor {
namespace detail {
template <class...>
struct Vertex;
struct VertexType;
template <class A1>
struct Vertex<A1> {
using Type = Vertex<A1>;
struct VertexType<A1> {
using Type = VertexType<A1>;
typename A1::Value a1;
} MBGL_VERTEX_ALIGN;
template <class A1, class A2>
struct Vertex<A1, A2> {
using Type = Vertex<A1, A2>;
struct VertexType<A1, A2> {
using Type = VertexType<A1, A2>;
typename A1::Value a1;
typename A2::Value a2;
} MBGL_VERTEX_ALIGN;
template <class A1, class A2, class A3>
struct Vertex<A1, A2, A3> {
using Type = Vertex<A1, A2, A3>;
struct VertexType<A1, A2, A3> {
using Type = VertexType<A1, A2, A3>;
typename A1::Value a1;
typename A2::Value a2;
typename A3::Value a3;
} MBGL_VERTEX_ALIGN;
template <class A1, class A2, class A3, class A4>
struct Vertex<A1, A2, A3, A4> {
using Type = Vertex<A1, A2, A3, A4>;
struct VertexType<A1, A2, A3, A4> {
using Type = VertexType<A1, A2, A3, A4>;
typename A1::Value a1;
typename A2::Value a2;
typename A3::Value a3;
@@ -122,8 +140,8 @@ struct Vertex<A1, A2, A3, A4> {
} MBGL_VERTEX_ALIGN;
template <class A1, class A2, class A3, class A4, class A5>
struct Vertex<A1, A2, A3, A4, A5> {
using Type = Vertex<A1, A2, A3, A4, A5>;
struct VertexType<A1, A2, A3, A4, A5> {
using Type = VertexType<A1, A2, A3, A4, A5>;
typename A1::Value a1;
typename A2::Value a2;
typename A3::Value a3;
@@ -135,8 +153,8 @@ template <class>
struct Descriptor;
template <class A1>
struct Descriptor<Vertex<A1>> {
using Type = Vertex<A1>;
struct Descriptor<VertexType<A1>> {
using Type = VertexType<A1>;
static_assert(sizeof(Type) < 256, "vertex type must be smaller than 256 bytes");
static_assert(std::is_standard_layout<Type>::value, "vertex type must use standard layout");
static constexpr const VertexDescriptor data = { sizeof(Type), 1, {
@@ -145,11 +163,11 @@ struct Descriptor<Vertex<A1>> {
};
template <class A1>
constexpr const VertexDescriptor Descriptor<Vertex<A1>>::data;
constexpr const VertexDescriptor Descriptor<VertexType<A1>>::data;
template <class A1, class A2>
struct Descriptor<Vertex<A1, A2>> {
using Type = Vertex<A1, A2>;
struct Descriptor<VertexType<A1, A2>> {
using Type = VertexType<A1, A2>;
static_assert(sizeof(Type) < 256, "vertex type must be smaller than 256 bytes");
static_assert(std::is_standard_layout<Type>::value, "vertex type must use standard layout");
static constexpr const VertexDescriptor data = { sizeof(Type), 2, {
@@ -159,11 +177,11 @@ struct Descriptor<Vertex<A1, A2>> {
};
template <class A1, class A2>
constexpr const VertexDescriptor Descriptor<Vertex<A1, A2>>::data;
constexpr const VertexDescriptor Descriptor<VertexType<A1, A2>>::data;
template <class A1, class A2, class A3>
struct Descriptor<Vertex<A1, A2, A3>> {
using Type = Vertex<A1, A2, A3>;
struct Descriptor<VertexType<A1, A2, A3>> {
using Type = VertexType<A1, A2, A3>;
static_assert(sizeof(Type) < 256, "vertex type must be smaller than 256 bytes");
static_assert(std::is_standard_layout<Type>::value, "vertex type must use standard layout");
static constexpr const VertexDescriptor data = { sizeof(Type), 3, {
@@ -174,11 +192,11 @@ struct Descriptor<Vertex<A1, A2, A3>> {
};
template <class A1, class A2, class A3>
constexpr const VertexDescriptor Descriptor<Vertex<A1, A2, A3>>::data;
constexpr const VertexDescriptor Descriptor<VertexType<A1, A2, A3>>::data;
template <class A1, class A2, class A3, class A4>
struct Descriptor<Vertex<A1, A2, A3, A4>> {
using Type = Vertex<A1, A2, A3, A4>;
struct Descriptor<VertexType<A1, A2, A3, A4>> {
using Type = VertexType<A1, A2, A3, A4>;
static_assert(sizeof(Type) < 256, "vertex type must be smaller than 256 bytes");
static_assert(std::is_standard_layout<Type>::value, "vertex type must use standard layout");
static constexpr const VertexDescriptor data = { sizeof(Type), 4, {
@@ -190,11 +208,11 @@ struct Descriptor<Vertex<A1, A2, A3, A4>> {
};
template <class A1, class A2, class A3, class A4>
constexpr const VertexDescriptor Descriptor<Vertex<A1, A2, A3, A4>>::data;
constexpr const VertexDescriptor Descriptor<VertexType<A1, A2, A3, A4>>::data;
template <class A1, class A2, class A3, class A4, class A5>
struct Descriptor<Vertex<A1, A2, A3, A4, A5>> {
using Type = Vertex<A1, A2, A3, A4, A5>;
struct Descriptor<VertexType<A1, A2, A3, A4, A5>> {
using Type = VertexType<A1, A2, A3, A4, A5>;
static_assert(sizeof(Type) < 256, "vertex type must be smaller than 256 bytes");
static_assert(std::is_standard_layout<Type>::value, "vertex type must use standard layout");
static constexpr const VertexDescriptor data = { sizeof(Type), 5, {
@@ -207,11 +225,14 @@ struct Descriptor<Vertex<A1, A2, A3, A4, A5>> {
};
template <class A1, class A2, class A3, class A4, class A5>
constexpr const VertexDescriptor Descriptor<Vertex<A1, A2, A3, A4, A5>>::data;
constexpr const VertexDescriptor Descriptor<VertexType<A1, A2, A3, A4, A5>>::data;
template <class>
struct Vertex;
template <class... As>
struct Vertex<TypeList<As...>> {
using Type = Vertex<typename As::Type...>;
using Type = VertexType<typename As::Type...>;
};
} // namespace detail
@@ -219,8 +240,52 @@ struct Vertex<TypeList<As...>> {
template <class A>
using Vertex = typename detail::Vertex<A>::Type;
template <class V>
using VertexDescriptorOf = detail::Descriptor<V>;
template <class T>
using VertexType = typename detail::VertexType<T>;
template <size_t I = 0, class... As>
AttributeBinding attributeBinding(const VertexBuffer<detail::VertexType<As...>>& buffer) {
using Descriptor = detail::Descriptor<detail::VertexType<As...>>;
static_assert(I < Descriptor::data.count, "attribute index must be in range");
return {
Descriptor::data.attributes[I],
Descriptor::data.stride,
buffer.resource.get(),
0,
};
}
optional<gfx::AttributeBinding> offsetAttributeBinding(const optional<gfx::AttributeBinding>& binding, std::size_t vertexOffset);
template <class>
class AttributeBindings;
template <class... As>
class AttributeBindings<TypeList<As...>> final
: public IndexedTuple<TypeList<As...>,
TypeList<ExpandToType<As, optional<AttributeBinding>>...>> {
using Base = IndexedTuple<TypeList<As...>,
TypeList<ExpandToType<As, optional<AttributeBinding>>...>>;
public:
AttributeBindings(const VertexBuffer<Vertex<TypeList<As...>>>& buffer)
: Base{ attributeBinding<TypeIndex<As, As...>::value>(buffer)... } {
}
template <class... Args>
AttributeBindings(Args&&... args) : Base(std::forward<Args>(args)...) {
}
AttributeBindings offset(const std::size_t vertexOffset) const {
return { offsetAttributeBinding(Base::template get<As>(), vertexOffset)... };
}
uint32_t activeCount() const {
uint32_t result = 0;
util::ignore({ ((result += bool(Base::template get<As>())), 0)... });
return result;
}
};
} // namespace gfx
} // namespace mbgl

View File

@@ -5,14 +5,22 @@
#include <mbgl/gfx/index_vector.hpp>
#include <mbgl/gfx/index_buffer.hpp>
#include <mbgl/gfx/texture.hpp>
#include <mbgl/gfx/draw_scope.hpp>
#include <mbgl/gfx/program.hpp>
#include <mbgl/gfx/types.hpp>
namespace mbgl {
class ProgramParameters;
namespace gfx {
class Context {
protected:
Context() = default;
Context(ContextType type_) : backend(type_) {
}
const ContextType backend;
public:
Context(Context&&) = delete;
@@ -89,6 +97,22 @@ protected:
Size, const void* data, TexturePixelType, TextureChannelDataType) = 0;
virtual void updateTextureResource(const TextureResource&, Size, const void* data,
TexturePixelType, TextureChannelDataType) = 0;
public:
DrawScope createDrawScope() {
return { createDrawScopeResource() };
}
protected:
virtual std::unique_ptr<DrawScopeResource> createDrawScopeResource() = 0;
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&);
};
} // namespace gfx

View File

@@ -0,0 +1,23 @@
#pragma once
#include <mbgl/gfx/context.hpp>
namespace mbgl {
namespace gl {
class Context;
} // namespace gl
namespace gfx {
template <typename Name>
std::unique_ptr<Program<Name>> Context::createProgram(const ProgramParameters& programParameters) {
if (backend == ContextType::OpenGL) {
return createProgram<gl::Context, Name>(programParameters);
}
assert(false);
return nullptr;
}
} // namespace gfx
} // namespace mbgl

View File

@@ -1,72 +1,77 @@
#pragma once
#include <mbgl/gfx/types.hpp>
#include <mbgl/gfx/primitives.hpp>
#include <cassert>
namespace mbgl {
namespace gfx {
class Points {
public:
using Primitive = Point;
static constexpr std::size_t bufferGroupSize = 1;
static constexpr PrimitiveType primitiveType = PrimitiveType::Points;
explicit Points(float pointSize_) : pointSize(pointSize_) {}
float pointSize;
};
class Lines {
public:
using Primitive = Line;
static constexpr std::size_t bufferGroupSize = 2;
static constexpr PrimitiveType primitiveType = PrimitiveType::Lines;
explicit Lines(float lineWidth_) : lineWidth(lineWidth_) {
assert(lineWidth > 0);
class DrawMode {
protected:
DrawMode(DrawModeType type_, float size_)
: type(type_), size(size_) {
}
float lineWidth;
public:
const DrawModeType type;
const float size;
};
class LineStrip {
template <class> struct BufferGroupSizeOf;
template <class> struct PrimitiveTypeOf;
class Points : public DrawMode {
public:
// LineStrip is a form of "Line" rendering, but the element buffer
// cannot be grouped into logical elements beyond a single Point.
using Primitive = Line;
static constexpr std::size_t bufferGroupSize = 1;
static constexpr PrimitiveType primitiveType = PrimitiveType::LineStrip;
explicit LineStrip(float lineWidth_) : lineWidth(lineWidth_) {
assert(lineWidth > 0);
explicit Points(float pointSize_) : DrawMode(DrawModeType::Points, pointSize_) {
assert(size > 0);
}
float lineWidth;
};
class Triangles {
template <> struct BufferGroupSizeOf<Points> : std::integral_constant<std::size_t, 1> {};
template <> struct PrimitiveTypeOf<Points> : std::integral_constant<PrimitiveType, PrimitiveType::Point> {};
class Lines : public DrawMode {
public:
using Primitive = Triangle;
static constexpr std::size_t bufferGroupSize = 3;
static constexpr PrimitiveType primitiveType = PrimitiveType::Triangles;
explicit Lines(float lineWidth_) : DrawMode(DrawModeType::Lines, lineWidth_) {
assert(size > 0);
}
};
class TriangleStrip {
template <> struct BufferGroupSizeOf<Lines> : std::integral_constant<std::size_t, 2> {};
template <> struct PrimitiveTypeOf<Lines> : std::integral_constant<PrimitiveType, PrimitiveType::Line> {};
// LineStrip is a form of "Line" rendering, but the element buffer
// cannot be grouped into logical elements beyond a single Point.
class LineStrip : public DrawMode {
public:
// TriangleStrip is a form of "Triangle" rendering, but the element buffer
// cannot be grouped into logical elements beyond a single Point.
using Primitive = Triangle;
static constexpr std::size_t bufferGroupSize = 1;
static constexpr PrimitiveType primitiveType = PrimitiveType::TriangleStrip;
explicit LineStrip(float lineWidth_) : DrawMode(DrawModeType::LineStrip, lineWidth_) {
assert(size > 0);
}
};
template <> struct BufferGroupSizeOf<LineStrip> : std::integral_constant<std::size_t, 1> {};
template <> struct PrimitiveTypeOf<LineStrip> : std::integral_constant<PrimitiveType, PrimitiveType::Line> {};
class Triangles : public DrawMode {
public:
explicit Triangles() : DrawMode(DrawModeType::Triangles, 0) {
}
};
template <> struct BufferGroupSizeOf<Triangles> : std::integral_constant<std::size_t, 3> {};
template <> struct PrimitiveTypeOf<Triangles> : std::integral_constant<PrimitiveType, PrimitiveType::Triangle> {};
// TriangleStrip is a form of "Triangle" rendering, but the element buffer
// cannot be grouped into logical elements beyond a single Point.
class TriangleStrip : public DrawMode {
public:
explicit TriangleStrip() : DrawMode(DrawModeType::TriangleStrip, 0) {
}
};
template <> struct BufferGroupSizeOf<TriangleStrip> : std::integral_constant<std::size_t, 1> {};
template <> struct PrimitiveTypeOf<TriangleStrip> : std::integral_constant<PrimitiveType, PrimitiveType::Triangle> {};
} // namespace gfx
} // namespace mbgl

View File

@@ -0,0 +1,21 @@
#pragma once
#include <memory>
namespace mbgl {
namespace gfx {
class DrawScopeResource {
protected:
DrawScopeResource() = default;
public:
virtual ~DrawScopeResource() = default;
};
class DrawScope {
public:
std::unique_ptr<DrawScopeResource> resource;
};
} // namespace gfx
} // namespace mbgl

View File

@@ -1,5 +1,6 @@
#pragma once
#include <mbgl/gfx/draw_mode.hpp>
#include <mbgl/util/ignore.hpp>
#include <vector>
@@ -10,7 +11,7 @@ namespace gfx {
template <class DrawMode>
class IndexVector {
public:
static constexpr std::size_t groupSize = DrawMode::bufferGroupSize;
static constexpr std::size_t groupSize = BufferGroupSizeOf<DrawMode>::value;
template <class... Args>
void emplace_back(Args&&... args) {

View File

@@ -1,24 +0,0 @@
#pragma once
#include <cstddef>
namespace mbgl {
namespace gfx {
class Point {
public:
static constexpr std::size_t vertexCount = 1;
};
class Line {
public:
static constexpr std::size_t vertexCount = 2;
};
class Triangle {
public:
static constexpr std::size_t vertexCount = 3;
};
} // namespace gfx
} // namespace mbgl

53
src/mbgl/gfx/program.hpp Normal file
View File

@@ -0,0 +1,53 @@
#pragma once
#include <cstddef>
namespace mbgl {
namespace gfx {
class Context;
class DrawMode;
class DepthMode;
class StencilMode;
class ColorMode;
class CullFaceMode;
class DrawScope;
class IndexBuffer;
template <class> class UniformValues;
template <class> class AttributeBindings;
template <class> class TextureBindings;
template <class Name>
class Program {
protected:
Program() = default;
public:
virtual ~Program() = default;
Program(Program&&) = delete;
Program(const Program&) = delete;
Program& operator=(Program&&) = delete;
Program& operator=(const Program&) = delete;
using AttributeList = typename Name::AttributeList;
using UniformList = typename Name::UniformList;
using TextureList = typename Name::TextureList;
virtual void draw(Context&,
const DrawMode&,
const DepthMode&,
const StencilMode&,
const ColorMode&,
const CullFaceMode&,
const UniformValues<UniformList>&,
DrawScope&,
const AttributeBindings<AttributeList>&,
const TextureBindings<TextureList>&,
const IndexBuffer&,
std::size_t indexOffset,
std::size_t indexLength) = 0;
};
} // namespace gfx
} // namespace mbgl

View File

@@ -52,21 +52,19 @@ public:
TextureWrapType wrapY;
};
namespace detail {
template <class>
class TextureBindings;
template <class... Ts>
class TextureBindings<TypeList<Ts...>> {
class TextureBindings<TypeList<Ts...>> final
: public IndexedTuple<TypeList<Ts...>, TypeList<ExpandToType<Ts, TextureBinding>...>> {
using Base = IndexedTuple<TypeList<Ts...>, TypeList<ExpandToType<Ts, TextureBinding>...>>;
public:
using Type = IndexedTuple<TypeList<Ts...>, TypeList<ExpandToType<Ts, TextureBinding>...>>;
template <class... Args>
TextureBindings(Args&&... args) : Base(std::forward<Args>(args)...) {
}
};
} // namespace detail
template <class TextureTypeList>
using TextureBindings = typename detail::TextureBindings<TextureTypeList>::Type;
} // namespace gfx
} // namespace mbgl

View File

@@ -5,7 +5,17 @@
namespace mbgl {
namespace gfx {
enum class ContextType : uint8_t {
OpenGL,
};
enum class PrimitiveType : uint8_t {
Point,
Line,
Triangle,
};
enum class DrawModeType : uint8_t {
Points,
Lines,
LineLoop,

View File

@@ -31,21 +31,20 @@
namespace mbgl {
namespace gfx {
namespace detail {
template <class>
class UniformValues;
template <class... Us>
class UniformValues<TypeList<Us...>> {
class UniformValues<TypeList<Us...>> final
: public IndexedTuple<TypeList<Us...>, TypeList<typename Us::Value...>> {
using Base = IndexedTuple<TypeList<Us...>, TypeList<typename Us::Value...>>;
public:
using Type = IndexedTuple<TypeList<Us...>, TypeList<typename Us::Value...>>;
template <class... Args>
UniformValues(Args&&... args) : Base(std::forward<Args>(args)...) {
}
};
} // namespace detail
template <class UniformTypeList>
using UniformValues = typename detail::UniformValues<UniformTypeList>::Type;
} // namespace gfx
} // namespace mbgl

View File

@@ -7,17 +7,6 @@ namespace gl {
using namespace platform;
optional<AttributeBinding> offsetAttributeBinding(const optional<AttributeBinding>& binding, std::size_t vertexOffset) {
assert(vertexOffset <= std::numeric_limits<uint32_t>::max());
if (binding) {
AttributeBinding result = *binding;
result.vertexOffset = static_cast<uint32_t>(vertexOffset);
return result;
} else {
return binding;
}
}
void bindAttributeLocation(Context& context, ProgramID id, AttributeLocation location, const char* name) {
// We're using sequentially numberered attribute locations starting with 0. Therefore we can use
// the location as a proxy for the number of attributes.

View File

@@ -2,7 +2,6 @@
#include <mbgl/gfx/attribute.hpp>
#include <mbgl/gl/types.hpp>
#include <mbgl/gfx/vertex_buffer.hpp>
#include <mbgl/util/ignore.hpp>
#include <mbgl/util/indexed_tuple.hpp>
#include <mbgl/util/optional.hpp>
@@ -18,83 +17,50 @@
namespace mbgl {
namespace gl {
class AttributeBinding {
public:
gfx::AttributeDescriptor attribute;
uint8_t vertexStride;
const gfx::VertexBufferResource* vertexBufferResource;
uint32_t vertexOffset;
friend bool operator==(const AttributeBinding& lhs, const AttributeBinding& rhs) {
return lhs.attribute == rhs.attribute &&
lhs.vertexStride == rhs.vertexStride &&
lhs.vertexBufferResource == rhs.vertexBufferResource &&
lhs.vertexOffset == rhs.vertexOffset;
}
};
using AttributeBindingArray = std::vector<optional<AttributeBinding>>;
/*
Create a binding for this attribute. The `attributeSize` parameter may be used to
override the number of components available in the buffer for each vertex. Thus,
a buffer with only one float for each vertex can be bound to a `vec2` attribute
*/
template <std::size_t I, typename Vertex>
AttributeBinding attributeBinding(const gfx::VertexBuffer<Vertex>& buffer) {
static_assert(I < gfx::VertexDescriptorOf<Vertex>::data.count, "vertex attribute index out of range");
return {
gfx::VertexDescriptorOf<Vertex>::data.attributes[I],
gfx::VertexDescriptorOf<Vertex>::data.stride,
buffer.resource.get(),
0,
};
}
optional<AttributeBinding> offsetAttributeBinding(const optional<AttributeBinding>& binding, std::size_t vertexOffset);
using AttributeBindingArray = std::vector<optional<gfx::AttributeBinding>>;
using NamedAttributeLocations = std::vector<std::pair<const std::string, AttributeLocation>>;
class Context;
void bindAttributeLocation(Context&, ProgramID, AttributeLocation, const char * name);
std::set<std::string> getActiveAttributes(ProgramID);
template <class>
class Attributes;
class AttributeLocations;
template <class... As>
class Attributes<TypeList<As...>> final {
class AttributeLocations<TypeList<As...>> final {
private:
using Locations =
IndexedTuple<TypeList<As...>, TypeList<ExpandToType<As, optional<AttributeLocation>>...>>;
Locations locations;
public:
using Types = TypeList<As...>;
using Locations = IndexedTuple<
TypeList<As...>,
TypeList<ExpandToType<As, optional<AttributeLocation>>...>>;
using Bindings = IndexedTuple<
TypeList<As...>,
TypeList<ExpandToType<As, optional<AttributeBinding>>...>>;
using NamedLocations = std::vector<std::pair<const std::string, AttributeLocation>>;
AttributeLocations(Context& context, const ProgramID& id)
: locations([&] {
std::set<std::string> activeAttributes = getActiveAttributes(id);
static Locations bindLocations(Context& context, const ProgramID& id) {
std::set<std::string> activeAttributes = getActiveAttributes(id);
AttributeLocation location = 0;
auto maybeBindLocation = [&](const char* name) -> optional<AttributeLocation> {
if (activeAttributes.count(name)) {
bindAttributeLocation(context, id, location, name);
return location++;
} else {
return {};
}
};
AttributeLocation location = 0;
auto maybeBindLocation = [&](const char* name) -> optional<AttributeLocation> {
if (activeAttributes.count(name)) {
bindAttributeLocation(context, id, location, name);
return location++;
} else {
return {};
}
};
return Locations { maybeBindLocation(As::name())... };
return Locations{ maybeBindLocation(As::name())... };
}()) {
}
template <class Program>
static Locations loadNamedLocations(const Program& program) {
return Locations{ program.attributeLocation(As::name())... };
template <class BinaryProgram>
AttributeLocations(const BinaryProgram& program)
: locations{ program.attributeLocation(As::name())... } {
}
static NamedLocations getNamedLocations(const Locations& locations) {
NamedLocations result;
NamedAttributeLocations getNamedLocations() const {
NamedAttributeLocations result;
auto maybeAddLocation = [&] (const std::string& name, const optional<AttributeLocation>& location) {
if (location) {
@@ -107,20 +73,12 @@ public:
return result;
}
static Bindings bindings(const gfx::VertexBuffer<gfx::Vertex<Types>>& buffer) {
return Bindings { attributeBinding<TypeIndex<As, As...>::value>(buffer)... };
}
static Bindings offsetBindings(const Bindings& bindings, std::size_t vertexOffset) {
return Bindings { offsetAttributeBinding(bindings.template get<As>(), vertexOffset)... };
}
static AttributeBindingArray toBindingArray(const Locations& locations, const Bindings& bindings) {
AttributeBindingArray toBindingArray(const gfx::AttributeBindings<TypeList<As...>>& bindings) const {
AttributeBindingArray result;
result.resize(sizeof...(As));
auto maybeAddBinding = [&] (const optional<AttributeLocation>& location,
const optional<AttributeBinding>& binding) {
const optional<gfx::AttributeBinding>& binding) {
if (location) {
result.at(*location) = binding;
}
@@ -130,12 +88,6 @@ public:
return result;
}
static uint32_t activeBindingCount(const Bindings& bindings) {
uint32_t result = 0;
util::ignore({ ((result += bool(bindings.template get<As>())), 0)... });
return result;
}
};
} // namespace gl

View File

@@ -1,4 +1,4 @@
#include <mbgl/programs/binary_program.hpp>
#include <mbgl/gl/binary_program.hpp>
#include <protozero/pbf_reader.hpp>
#include <protozero/pbf_writer.hpp>
@@ -31,6 +31,7 @@ static std::pair<const std::string, Binding> parseBinding(protozero::pbf_reader&
}
namespace mbgl {
namespace gl {
BinaryProgram::BinaryProgram(std::string&& data) {
bool hasFormat = false, hasCode = false;
@@ -137,4 +138,5 @@ gl::UniformLocation BinaryProgram::textureLocation(const std::string& name) cons
return -1;
}
} // namespace gl
} // namespace mbgl

View File

@@ -7,6 +7,7 @@
#include <vector>
namespace mbgl {
namespace gl {
class BinaryProgram {
public:
@@ -45,4 +46,5 @@ private:
std::vector<std::pair<const std::string, gl::UniformLocation>> textures;
};
} // namespace gl
} // namespace mbgl

View File

@@ -3,6 +3,7 @@
#include <mbgl/gl/vertex_buffer_resource.hpp>
#include <mbgl/gl/index_buffer_resource.hpp>
#include <mbgl/gl/texture_resource.hpp>
#include <mbgl/gl/draw_scope_resource.hpp>
#include <mbgl/gl/texture.hpp>
#include <mbgl/gl/debugging_extension.hpp>
#include <mbgl/gl/vertex_array_extension.hpp>
@@ -66,7 +67,7 @@ static_assert(underlying_type(UniformDataType::SamplerCube) == GL_SAMPLER_CUBE,
static_assert(std::is_same<BinaryProgramFormat, GLenum>::value, "OpenGL type mismatch");
Context::Context()
: maximumVertexBindingCount([] {
: gfx::Context(gfx::ContextType::OpenGL), maximumVertexBindingCount([] {
GLint value;
MBGL_CHECK_ERROR(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value));
return value;
@@ -190,6 +191,8 @@ UniqueProgram Context::createProgram(ShaderID vertexShader, ShaderID fragmentSha
MBGL_CHECK_ERROR(glAttachShader(result, vertexShader));
MBGL_CHECK_ERROR(glAttachShader(result, fragmentShader));
linkProgram(result);
return result;
}
@@ -544,6 +547,10 @@ void Context::updateTextureResource(const gfx::TextureResource& resource,
Enum<gfx::TextureChannelDataType>::to(type), data));
}
std::unique_ptr<gfx::DrawScopeResource> Context::createDrawScopeResource() {
return std::make_unique<gl::DrawScopeResource>(createVertexArray());
}
void Context::reset() {
std::copy(pooledTextures.begin(), pooledTextures.end(), std::back_inserter(abandonedTextures));
pooledTextures.resize(0);
@@ -628,29 +635,6 @@ void Context::setCullFaceMode(const gfx::CullFaceMode& mode) {
cullFaceWinding = mode.winding;
}
#if not MBGL_USE_GLES2
void Context::setDrawMode(const gfx::Points& points) {
pointSize = points.pointSize;
}
#else
void Context::setDrawMode(const gfx::Points&) {
}
#endif // MBGL_USE_GLES2
void Context::setDrawMode(const gfx::Lines& lines) {
lineWidth = lines.lineWidth;
}
void Context::setDrawMode(const gfx::LineStrip& lineStrip) {
lineWidth = lineStrip.lineWidth;
}
void Context::setDrawMode(const gfx::Triangles&) {
}
void Context::setDrawMode(const gfx::TriangleStrip&) {
}
void Context::setDepthMode(const gfx::DepthMode& depth) {
if (depth.func == gfx::DepthFunctionType::Always && depth.mask != gfx::DepthMaskType::ReadWrite) {
depthTest = false;
@@ -697,11 +681,27 @@ void Context::setColorMode(const gfx::ColorMode& color) {
colorMask = color.mask;
}
void Context::draw(gfx::PrimitiveType primitiveType,
void Context::draw(const gfx::DrawMode& drawMode,
std::size_t indexOffset,
std::size_t indexLength) {
switch (drawMode.type) {
case gfx::DrawModeType::Points:
#if not MBGL_USE_GLES2
// In OpenGL ES 2, the point size is set in the vertex shader.
pointSize = drawMode.size;
#endif // MBGL_USE_GLES2
break;
case gfx::DrawModeType::Lines:
case gfx::DrawModeType::LineLoop:
case gfx::DrawModeType::LineStrip:
lineWidth = drawMode.size;
break;
default:
break;
}
MBGL_CHECK_ERROR(glDrawElements(
Enum<gfx::PrimitiveType>::to(primitiveType),
Enum<gfx::DrawModeType>::to(drawMode.type),
static_cast<GLsizei>(indexLength),
GL_UNSIGNED_SHORT,
reinterpret_cast<GLvoid*>(sizeof(uint16_t) * indexOffset)));

View File

@@ -52,7 +52,6 @@ public:
void verifyProgramLinkage(ProgramID);
void linkProgram(ProgramID);
UniqueTexture createUniqueTexture();
VertexArray createVertexArray();
#if MBGL_HAS_BINARY_PROGRAMS
bool supportsProgramBinaries() const;
@@ -100,18 +99,12 @@ public:
optional<float> depth,
optional<int32_t> stencil);
void setDrawMode(const gfx::Points&);
void setDrawMode(const gfx::Lines&);
void setDrawMode(const gfx::LineStrip&);
void setDrawMode(const gfx::Triangles&);
void setDrawMode(const gfx::TriangleStrip&);
void setDepthMode(const gfx::DepthMode&);
void setStencilMode(const gfx::StencilMode&);
void setColorMode(const gfx::ColorMode&);
void setCullFaceMode(const gfx::CullFaceMode&);
void draw(gfx::PrimitiveType,
void draw(const gfx::DrawMode&,
std::size_t indexOffset,
std::size_t indexLength);
@@ -216,6 +209,8 @@ private:
std::unique_ptr<gfx::TextureResource> createTextureResource(Size, const void* data, gfx::TexturePixelType, gfx::TextureChannelDataType) override;
void updateTextureResource(const gfx::TextureResource&, Size, const void* data, gfx::TexturePixelType, gfx::TextureChannelDataType) override;
std::unique_ptr<gfx::DrawScopeResource> createDrawScopeResource() override;
UniqueFramebuffer createFramebuffer();
UniqueRenderbuffer createRenderbuffer(RenderbufferType, Size size);
std::unique_ptr<uint8_t[]> readFramebuffer(Size, gfx::TexturePixelType, bool flip);
@@ -223,6 +218,7 @@ private:
void drawPixels(Size size, const void* data, gfx::TexturePixelType);
#endif // MBGL_USE_GLES2
VertexArray createVertexArray();
bool supportsVertexArrays() const;
friend detail::ProgramDeleter;

View File

@@ -0,0 +1,18 @@
#pragma once
#include <mbgl/gfx/draw_scope.hpp>
#include <mbgl/gl/vertex_array.hpp>
namespace mbgl {
namespace gl {
class DrawScopeResource : public gfx::DrawScopeResource {
public:
DrawScopeResource(VertexArray&& vertexArray_) : vertexArray(std::move(vertexArray_)) {
}
VertexArray vertexArray;
};
} // namespace gl
} // namespace mbgl

View File

@@ -6,15 +6,15 @@ namespace mbgl {
namespace gl {
template <>
platform::GLenum Enum<gfx::PrimitiveType>::to(const gfx::PrimitiveType value) {
platform::GLenum Enum<gfx::DrawModeType>::to(const gfx::DrawModeType value) {
switch (value) {
case gfx::PrimitiveType::Points: return GL_POINTS;
case gfx::PrimitiveType::Lines: return GL_LINES;
case gfx::PrimitiveType::LineLoop: return GL_LINE_LOOP;
case gfx::PrimitiveType::LineStrip: return GL_LINE_STRIP;
case gfx::PrimitiveType::Triangles: return GL_TRIANGLES;
case gfx::PrimitiveType::TriangleStrip: return GL_TRIANGLE_STRIP;
case gfx::PrimitiveType::TriangleFan: return GL_TRIANGLE_FAN;
case gfx::DrawModeType::Points: return GL_POINTS;
case gfx::DrawModeType::Lines: return GL_LINES;
case gfx::DrawModeType::LineLoop: return GL_LINE_LOOP;
case gfx::DrawModeType::LineStrip: return GL_LINE_STRIP;
case gfx::DrawModeType::Triangles: return GL_TRIANGLES;
case gfx::DrawModeType::TriangleStrip: return GL_TRIANGLE_STRIP;
case gfx::DrawModeType::TriangleFan: return GL_TRIANGLE_FAN;
}
return GL_INVALID_ENUM;
}

View File

@@ -1,80 +1,79 @@
#pragma once
#include <mbgl/gfx/program.hpp>
#include <mbgl/gl/types.hpp>
#include <mbgl/gl/object.hpp>
#include <mbgl/gl/context.hpp>
#include <mbgl/gl/draw_scope_resource.hpp>
#include <mbgl/gfx/vertex_buffer.hpp>
#include <mbgl/gfx/index_buffer.hpp>
#include <mbgl/gfx/uniform.hpp>
#include <mbgl/gl/vertex_array.hpp>
#include <mbgl/gl/attribute.hpp>
#include <mbgl/gl/uniform.hpp>
#include <mbgl/gl/texture.hpp>
#include <mbgl/gl/features.hpp>
#include <mbgl/gl/binary_program.hpp>
#include <mbgl/util/io.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/programs/binary_program.hpp>
#include <mbgl/programs/program_parameters.hpp>
#include <mbgl/shaders/shaders.hpp>
#include <mbgl/programs/gl/shaders.hpp>
#include <string>
namespace mbgl {
namespace gl {
template <class P, class As, class Us, class TextureList>
class Program {
template <class Name>
class Program final : public gfx::Program<Name> {
public:
using Primitive = P;
using Attributes = As;
using Uniforms = Us;
using UniformValues = typename Uniforms::Values;
using AttributeBindings = typename Attributes::Bindings;
using TextureBindings = gfx::TextureBindings<TextureList>;
using AttributeList = typename Name::AttributeList;
using UniformList = typename Name::UniformList;
using TextureList = typename Name::TextureList;
Program(Context& context, const std::string& vertexSource, const std::string& fragmentSource)
: program(
context.createProgram(context.createShader(ShaderType::Vertex, vertexSource),
context.createShader(ShaderType::Fragment, fragmentSource))),
uniformsState((context.linkProgram(program), Uniforms::bindLocations(program))),
attributeLocations(Attributes::bindLocations(context, program)) {
// Re-link program after manually binding only active attributes in Attributes::bindLocations
attributeLocations(context, program) {
// Re-link program after manually binding only active attributes in Attributes::queryLocations
context.linkProgram(program);
// We have to re-initialize the uniforms state from the bindings as the uniform locations
// get shifted on some implementations
uniformsState = Uniforms::bindLocations(program);
uniformStates.queryLocations(program);
// Texture units are specified via uniforms as well, so we need query their locations
textures.queryLocations(program);
textureStates.queryLocations(program);
}
template <class BinaryProgram>
Program(Context& context, const BinaryProgram& binaryProgram)
: program(context.createProgram(binaryProgram.format(), binaryProgram.code())),
uniformsState(Uniforms::loadNamedLocations(binaryProgram)),
attributeLocations(Attributes::loadNamedLocations(binaryProgram)) {
textures.loadNamedLocations(binaryProgram);
attributeLocations(binaryProgram) {
uniformStates.loadNamedLocations(binaryProgram);
textureStates.loadNamedLocations(binaryProgram);
}
static Program createProgram(gl::Context& context,
const ProgramParameters& programParameters,
const char* name,
const char* vertexSource_,
const char* fragmentSource_) {
const std::string vertexSource = shaders::vertexSource(programParameters, vertexSource_);
const std::string fragmentSource = shaders::fragmentSource(programParameters, fragmentSource_);
static std::unique_ptr<Program> createProgram(gl::Context& context,
const ProgramParameters& programParameters,
const char* name,
const char* vertexSource_,
const char* fragmentSource_) {
const std::string vertexSource = programs::gl::vertexSource(programParameters, vertexSource_);
const std::string fragmentSource = programs::gl::fragmentSource(programParameters, fragmentSource_);
#if MBGL_HAS_BINARY_PROGRAMS
optional<std::string> cachePath = programParameters.cachePath(name);
if (cachePath && context.supportsProgramBinaries()) {
const std::string identifier = shaders::programIdentifier(vertexSource, fragmentSource);
const std::string identifier = programs::gl::programIdentifier(vertexSource, fragmentSource);
try {
if (auto cachedBinaryProgram = util::readFile(*cachePath)) {
const BinaryProgram binaryProgram(std::move(*cachedBinaryProgram));
if (binaryProgram.identifier() == identifier) {
return Program { context, binaryProgram };
return std::make_unique<Program>(context, binaryProgram);
} else {
Log::Warning(Event::OpenGL,
"Cached program %s changed. Recompilation required.",
@@ -87,11 +86,11 @@ public:
}
// Compile the shader
Program result{ context, vertexSource, fragmentSource };
auto result = std::make_unique<Program>(context, vertexSource, fragmentSource);
try {
if (const auto binaryProgram =
result.template get<BinaryProgram>(context, identifier)) {
result->template get<BinaryProgram>(context, identifier)) {
util::write_file(*cachePath, binaryProgram->serialize());
Log::Warning(Event::OpenGL, "Caching program in: %s", (*cachePath).c_str());
}
@@ -104,37 +103,37 @@ public:
#endif
(void)name;
return Program { context, vertexSource, fragmentSource };
return std::make_unique<Program>(context, vertexSource, fragmentSource);
}
template <class BinaryProgram>
optional<BinaryProgram> get(Context& context, const std::string& identifier) const {
if (auto binaryProgram = context.getBinaryProgram(program)) {
return BinaryProgram{ binaryProgram->first, std::move(binaryProgram->second),
identifier, Attributes::getNamedLocations(attributeLocations),
Uniforms::getNamedLocations(uniformsState),
textures.getNamedLocations() };
return BinaryProgram{ binaryProgram->first,
std::move(binaryProgram->second),
identifier,
attributeLocations.getNamedLocations(),
uniformStates.getNamedLocations(),
textureStates.getNamedLocations() };
}
return {};
}
template <class DrawMode>
void draw(Context& context,
DrawMode drawMode,
gfx::DepthMode depthMode,
gfx::StencilMode stencilMode,
gfx::ColorMode colorMode,
gfx::CullFaceMode cullFaceMode,
const UniformValues& uniformValues,
gl::VertexArray& vertexArray,
const AttributeBindings& attributeBindings,
const TextureBindings& textureBindings,
void draw(gfx::Context& genericContext,
const gfx::DrawMode& drawMode,
const gfx::DepthMode& depthMode,
const gfx::StencilMode& stencilMode,
const gfx::ColorMode& colorMode,
const gfx::CullFaceMode& cullFaceMode,
const gfx::UniformValues<UniformList>& uniformValues,
gfx::DrawScope& drawScope,
const gfx::AttributeBindings<AttributeList>& attributeBindings,
const gfx::TextureBindings<TextureList>& textureBindings,
const gfx::IndexBuffer& indexBuffer,
std::size_t indexOffset,
std::size_t indexLength) {
static_assert(std::is_same<Primitive, typename DrawMode::Primitive>::value, "incompatible draw mode");
std::size_t indexLength) override {
auto& context = reinterpret_cast<gl::Context&>(genericContext);
context.setDrawMode(drawMode);
context.setDepthMode(depthMode);
context.setStencilMode(stencilMode);
context.setColorMode(colorMode);
@@ -142,15 +141,16 @@ public:
context.program = program;
Uniforms::bind(uniformsState, uniformValues);
uniformStates.bind(uniformValues);
textures.bind(context, textureBindings);
textureStates.bind(context, textureBindings);
auto& vertexArray = reinterpret_cast<gl::DrawScopeResource&>(*drawScope.resource).vertexArray;
vertexArray.bind(context,
indexBuffer,
Attributes::toBindingArray(attributeLocations, attributeBindings));
attributeLocations.toBindingArray(attributeBindings));
context.draw(drawMode.primitiveType,
context.draw(drawMode,
indexOffset,
indexLength);
}
@@ -158,9 +158,9 @@ public:
private:
UniqueProgram program;
typename Uniforms::State uniformsState;
typename Attributes::Locations attributeLocations;
gl::Textures<TextureList> textures;
gl::AttributeLocations<AttributeList> attributeLocations;
gl::UniformStates<UniformList> uniformStates;
gl::TextureStates<TextureList> textureStates;
};
} // namespace gl

View File

@@ -15,13 +15,15 @@ class Context;
void bindTexture(gl::Context&, uint8_t unit, const gfx::TextureBinding&);
template <class>
class Textures;
class TextureStates;
template <class... Ts>
class Textures<TypeList<Ts...>> {
class TextureStates<TypeList<Ts...>> {
private:
using State =
IndexedTuple<TypeList<Ts...>, TypeList<ExpandToType<Ts, gl::UniformState<uint8_t>>...>>;
using NamedLocations = std::vector<std::pair<const std::string, gl::UniformLocation>>;
State state;
public:
void queryLocations(const ProgramID& id) {
@@ -33,8 +35,8 @@ public:
state = State{ program.textureLocation(Ts::name())... };
}
NamedLocations getNamedLocations() const {
return NamedLocations{ { Ts::name(), state.template get<Ts>().location }... };
NamedUniformLocations getNamedLocations() const {
return NamedUniformLocations{ { Ts::name(), state.template get<Ts>().location }... };
}
void bind(gl::Context& context, const gfx::TextureBindings<TypeList<Ts...>>& bindings) {
@@ -43,9 +45,6 @@ public:
gl::bindTexture(context, TypeIndex<Ts, Ts...>::value, bindings.template get<Ts>()),
0)... });
}
private:
State state;
};
} // namespace gl

View File

@@ -1,5 +1,6 @@
#pragma once
#include <mbgl/gfx/uniform.hpp>
#include <mbgl/gl/types.hpp>
#include <mbgl/util/optional.hpp>
#include <mbgl/util/ignore.hpp>
@@ -49,23 +50,25 @@ public:
optional<Value> current = {};
};
UniformLocation uniformLocation(ProgramID, const char * name);
UniformLocation uniformLocation(ProgramID, const char* name);
using NamedUniformLocations = std::vector<std::pair<const std::string, UniformLocation>>;
template <class>
class Uniforms;
class UniformStates;
template <class... Us>
class Uniforms<TypeList<Us...>> final {
public:
using Types = TypeList<Us...>;
class UniformStates<TypeList<Us...>> final {
private:
using State = IndexedTuple<TypeList<Us...>, TypeList<UniformState<typename Us::Value>...>>;
using Values = IndexedTuple<TypeList<Us...>, TypeList<typename Us::Value...>>;
using NamedLocations = std::vector<std::pair<const std::string, UniformLocation>>;
static State bindLocations(const ProgramID& id) {
State state;
public:
void queryLocations(const ProgramID& id) {
#ifndef NDEBUG
// Verify active uniform types match the enum
const auto active = activeUniforms(id);
const auto active = gl::activeUniforms(id);
util::ignore(
{ // Some shader programs have uniforms declared, but not used, so they're not active.
@@ -75,19 +78,19 @@ public:
: false)... });
#endif
return State(uniformLocation(id, Us::name())...);
state = State{ gl::uniformLocation(id, Us::name())... };
}
template <class Program>
static State loadNamedLocations(const Program& program) {
return State(UniformState<typename Us::Value>(program.uniformLocation(Us::name()))...);
template <class BinaryProgram>
void loadNamedLocations(const BinaryProgram& program) {
state = State{ UniformState<typename Us::Value>(program.uniformLocation(Us::name()))... };
}
static NamedLocations getNamedLocations(const State& state) {
return NamedLocations{ { Us::name(), state.template get<Us>().location }... };
NamedUniformLocations getNamedLocations() const {
return NamedUniformLocations{ { Us::name(), state.template get<Us>().location }... };
}
static void bind(State& state, const Values& values) {
void bind(const gfx::UniformValues<TypeList<Us...>>& values) {
util::ignore({ (state.template get<Us>() = values.template get<Us>(), 0)... });
}
};

View File

@@ -397,7 +397,7 @@ BindVertexArray::Type BindVertexArray::Get(const Context& context) {
return binding;
}
const optional<AttributeBinding> VertexAttribute::Default {};
const VertexAttribute::Type VertexAttribute::Default {};
namespace {
@@ -484,7 +484,7 @@ GLint components(const gfx::AttributeDataType type) {
} // namespace
void VertexAttribute::Set(const optional<AttributeBinding>& binding, Context& context, AttributeLocation location) {
void VertexAttribute::Set(const Type& binding, Context& context, AttributeLocation location) {
if (binding) {
context.vertexBuffer = reinterpret_cast<const gl::VertexBufferResource&>(*binding->vertexBufferResource).buffer;
MBGL_CHECK_ERROR(glEnableVertexAttribArray(location));

View File

@@ -264,7 +264,7 @@ struct BindVertexArray {
};
struct VertexAttribute {
using Type = optional<gl::AttributeBinding>;
using Type = optional<gfx::AttributeBinding>;
static const Type Default;
static void Set(const Type&, Context&, AttributeLocation);
};

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/background_program.hpp>

View File

@@ -1,4 +1,5 @@
#include <mbgl/programs/background_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
#include <mbgl/renderer/image_atlas.hpp>
#include <mbgl/renderer/cross_faded_property_evaluator.hpp>
#include <mbgl/tile/tile_id.hpp>
@@ -6,20 +7,22 @@
namespace mbgl {
template std::unique_ptr<gfx::Program<BackgroundProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<BackgroundPatternProgram>> gfx::Context::createProgram(const ProgramParameters&);
using namespace style;
static_assert(sizeof(BackgroundLayoutVertex) == 4, "expected BackgroundLayoutVertex size");
BackgroundPatternProgram::UniformValues
BackgroundPatternProgram::uniformValues(mat4 matrix,
float opacity,
Size atlasSize,
const ImagePosition& a,
const ImagePosition& b,
const CrossfadeParameters& fading,
const UnwrappedTileID& tileID,
const TransformState& state)
{
BackgroundPatternProgram::LayoutUniformValues
BackgroundPatternProgram::layoutUniformValues(mat4 matrix,
float opacity,
Size atlasSize,
const ImagePosition& a,
const ImagePosition& b,
const CrossfadeParameters& fading,
const UnwrappedTileID& tileID,
const TransformState& state) {
int32_t tileSizeAtNearestZoom = util::tileSize * state.zoomScale(state.getIntegerZoom() - tileID.canonical.z);
int32_t pixelX = tileSizeAtNearestZoom * (tileID.canonical.x + tileID.wrap * state.zoomScale(tileID.canonical.z));
int32_t pixelY = tileSizeAtNearestZoom * tileID.canonical.y;

View File

@@ -4,14 +4,9 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/background.hpp>
#include <mbgl/shaders/background_pattern.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/util/mat4.hpp>
#include <mbgl/util/size.hpp>
#include <mbgl/style/layers/background_layer_properties.hpp>
#include <string>
namespace mbgl {
@@ -45,8 +40,8 @@ using BackgroundPatternUniforms = TypeList<
uniforms::u_tile_units_to_pixels>;
class BackgroundProgram : public Program<
shaders::background,
gfx::Triangle,
BackgroundProgram,
gfx::PrimitiveType::Triangle,
BackgroundLayoutAttributes,
BackgroundUniforms,
TypeList<>,
@@ -57,8 +52,8 @@ public:
};
class BackgroundPatternProgram : public Program<
shaders::background_pattern,
gfx::Triangle,
BackgroundPatternProgram,
gfx::PrimitiveType::Triangle,
BackgroundLayoutAttributes,
BackgroundPatternUniforms,
TypeList<
@@ -68,22 +63,22 @@ class BackgroundPatternProgram : public Program<
public:
using Program::Program;
static UniformValues uniformValues(mat4 matrix,
float opacity,
Size atlasSize,
const ImagePosition&,
const ImagePosition&,
const CrossfadeParameters&,
const UnwrappedTileID&,
const TransformState&);
static LayoutUniformValues layoutUniformValues(mat4 matrix,
float opacity,
Size atlasSize,
const ImagePosition&,
const ImagePosition&,
const CrossfadeParameters&,
const UnwrappedTileID&,
const TransformState&);
};
using BackgroundLayoutVertex = BackgroundProgram::LayoutVertex;
using BackgroundAttributes = BackgroundProgram::Attributes;
using BackgroundAttributes = BackgroundProgram::AttributeList;
class BackgroundLayerPrograms final : public LayerTypePrograms {
public:
BackgroundLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
BackgroundLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: background(context, programParameters),
backgroundPattern(context, programParameters) {}
BackgroundProgram background;

View File

@@ -1,7 +1,10 @@
#include <mbgl/programs/circle_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<CircleProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(CircleLayoutVertex) == 4, "expected CircleLayoutVertex size");
} // namespace mbgl

View File

@@ -3,7 +3,6 @@
#include <mbgl/programs/program.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/shaders/circle.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/style/layers/circle_layer_properties.hpp>
@@ -14,8 +13,8 @@ MBGL_DEFINE_UNIFORM_SCALAR(bool, u_scale_with_map);
} // namespace uniforms
class CircleProgram : public Program<
shaders::circle,
gfx::Triangle,
CircleProgram,
gfx::PrimitiveType::Triangle,
TypeList<
attributes::a_pos>,
TypeList<
@@ -47,11 +46,11 @@ public:
};
using CircleLayoutVertex = CircleProgram::LayoutVertex;
using CircleAttributes = CircleProgram::Attributes;
using CircleAttributes = CircleProgram::AttributeList;
class CircleLayerPrograms final : public LayerTypePrograms {
public:
CircleLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
CircleLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: circle(context, programParameters) {}
ProgramMap<CircleProgram> circle;
};

View File

@@ -0,0 +1,8 @@
#include <mbgl/programs/clipping_mask_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<ClippingMaskProgram>> gfx::Context::createProgram(const ProgramParameters&);
} // namespace mbgl

View File

@@ -3,14 +3,13 @@
#include <mbgl/programs/program.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/shaders/clipping_mask.hpp>
#include <mbgl/style/properties.hpp>
namespace mbgl {
class ClippingMaskProgram : public Program<
shaders::clipping_mask,
gfx::Triangle,
ClippingMaskProgram,
gfx::PrimitiveType::Triangle,
PositionOnlyLayoutAttributes,
TypeList<
uniforms::u_matrix>,
@@ -22,6 +21,6 @@ public:
};
using ClippingMaskLayoutVertex = ClippingMaskProgram::LayoutVertex;
using ClippingMaskAttributes = ClippingMaskProgram::Attributes;
using ClippingMaskAttributes = ClippingMaskProgram::AttributeList;
} // namespace mbgl

View File

@@ -1,7 +1,11 @@
#include <mbgl/programs/collision_box_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<CollisionBoxProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<CollisionCircleProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(CollisionBoxProgram::LayoutVertex) == 24, "expected CollisionBoxVertex size");
} // namespace mbgl

View File

@@ -3,8 +3,6 @@
#include <mbgl/programs/program.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/shaders/collision_box.hpp>
#include <mbgl/shaders/collision_circle.hpp>
#include <mbgl/style/properties.hpp>
#include <mbgl/util/geometry.hpp>
@@ -21,8 +19,8 @@ using CollisionBoxLayoutAttributes = TypeList<
using CollisionBoxDynamicAttributes = TypeList<attributes::a_placed>;
class CollisionBoxProgram : public Program<
shaders::collision_box,
gfx::Line,
CollisionBoxProgram,
gfx::PrimitiveType::Line,
TypeListConcat<CollisionBoxLayoutAttributes, CollisionBoxDynamicAttributes>,
TypeList<
uniforms::u_matrix,
@@ -62,48 +60,48 @@ public:
}
template <class DrawMode>
void draw(gl::Context& context,
DrawMode drawMode,
gfx::DepthMode depthMode,
gfx::StencilMode stencilMode,
gfx::ColorMode colorMode,
gfx::CullFaceMode cullFaceMode,
const UniformValues& uniformValues,
void draw(gfx::Context& context,
const DrawMode& drawMode,
const gfx::DepthMode& depthMode,
const gfx::StencilMode& stencilMode,
const gfx::ColorMode& colorMode,
const gfx::CullFaceMode& cullFaceMode,
const LayoutUniformValues& layoutUniformValues,
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer,
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer,
const gfx::IndexBuffer& indexBuffer,
const SegmentVector<Attributes>& segments,
const SegmentVector<AttributeList>& segments,
const Binders& paintPropertyBinders,
const typename PaintProperties::PossiblyEvaluated& currentProperties,
const TextureBindings& textureBindings,
float currentZoom,
const std::string& layerID) {
typename AllUniforms::Values allUniformValues = uniformValues
UniformValues uniformValues = layoutUniformValues
.concat(paintPropertyBinders.uniformValues(currentZoom, currentProperties));
typename Attributes::Bindings allAttributeBindings = gl::Attributes<CollisionBoxLayoutAttributes>::bindings(layoutVertexBuffer)
.concat(gl::Attributes<CollisionBoxDynamicAttributes>::bindings(dynamicVertexBuffer))
AttributeBindings allAttributeBindings = gfx::AttributeBindings<CollisionBoxLayoutAttributes>(layoutVertexBuffer)
.concat(gfx::AttributeBindings<CollisionBoxDynamicAttributes>(dynamicVertexBuffer))
.concat(paintPropertyBinders.attributeBindings(currentProperties));
assert(layoutVertexBuffer.elements == dynamicVertexBuffer.elements);
for (auto& segment : segments) {
auto vertexArrayIt = segment.vertexArrays.find(layerID);
auto drawScopeIt = segment.drawScopes.find(layerID);
if (vertexArrayIt == segment.vertexArrays.end()) {
vertexArrayIt = segment.vertexArrays.emplace(layerID, context.createVertexArray()).first;
if (drawScopeIt == segment.drawScopes.end()) {
drawScopeIt = segment.drawScopes.emplace(layerID, context.createDrawScope()).first;
}
program.draw(
program->draw(
context,
std::move(drawMode),
std::move(depthMode),
std::move(stencilMode),
std::move(colorMode),
std::move(cullFaceMode),
allUniformValues,
vertexArrayIt->second,
Attributes::offsetBindings(allAttributeBindings, segment.vertexOffset),
uniformValues,
drawScopeIt->second,
allAttributeBindings.offset(segment.vertexOffset),
textureBindings,
indexBuffer,
segment.indexOffset,
@@ -114,8 +112,8 @@ public:
class CollisionCircleProgram : public Program<
shaders::collision_circle,
gfx::Triangle,
CollisionCircleProgram,
gfx::PrimitiveType::Triangle,
TypeListConcat<CollisionBoxLayoutAttributes, CollisionBoxDynamicAttributes>,
TypeList<
uniforms::u_matrix,
@@ -150,46 +148,46 @@ public:
}
template <class DrawMode>
void draw(gl::Context& context,
DrawMode drawMode,
gfx::DepthMode depthMode,
gfx::StencilMode stencilMode,
gfx::ColorMode colorMode,
gfx::CullFaceMode cullFaceMode,
const UniformValues& uniformValues,
void draw(gfx::Context& context,
const DrawMode& drawMode,
const gfx::DepthMode& depthMode,
const gfx::StencilMode& stencilMode,
const gfx::ColorMode& colorMode,
const gfx::CullFaceMode& cullFaceMode,
const LayoutUniformValues& layoutUniformValues,
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>& layoutVertexBuffer,
const gfx::VertexBuffer<gfx::Vertex<CollisionBoxDynamicAttributes>>& dynamicVertexBuffer,
const gfx::IndexBuffer& indexBuffer,
const SegmentVector<Attributes>& segments,
const SegmentVector<AttributeList>& segments,
const Binders& paintPropertyBinders,
const typename PaintProperties::PossiblyEvaluated& currentProperties,
const TextureBindings& textureBindings,
float currentZoom,
const std::string& layerID) {
typename AllUniforms::Values allUniformValues = uniformValues
UniformValues uniformValues = layoutUniformValues
.concat(paintPropertyBinders.uniformValues(currentZoom, currentProperties));
typename Attributes::Bindings allAttributeBindings = gl::Attributes<CollisionBoxLayoutAttributes>::bindings(layoutVertexBuffer)
.concat(gl::Attributes<CollisionBoxDynamicAttributes>::bindings(dynamicVertexBuffer))
AttributeBindings allAttributeBindings = gfx::AttributeBindings<CollisionBoxLayoutAttributes>(layoutVertexBuffer)
.concat(gfx::AttributeBindings<CollisionBoxDynamicAttributes>(dynamicVertexBuffer))
.concat(paintPropertyBinders.attributeBindings(currentProperties));
for (auto& segment : segments) {
auto vertexArrayIt = segment.vertexArrays.find(layerID);
auto drawScopeIt = segment.drawScopes.find(layerID);
if (vertexArrayIt == segment.vertexArrays.end()) {
vertexArrayIt = segment.vertexArrays.emplace(layerID, context.createVertexArray()).first;
if (drawScopeIt == segment.drawScopes.end()) {
drawScopeIt = segment.drawScopes.emplace(layerID, context.createDrawScope()).first;
}
program.draw(
program->draw(
context,
std::move(drawMode),
std::move(depthMode),
std::move(stencilMode),
std::move(colorMode),
std::move(cullFaceMode),
allUniformValues,
vertexArrayIt->second,
Attributes::offsetBindings(allAttributeBindings, segment.vertexOffset),
uniformValues,
drawScopeIt->second,
allAttributeBindings.offset(segment.vertexOffset),
textureBindings,
indexBuffer,
segment.indexOffset,

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/collision_box_program.hpp>

View File

@@ -0,0 +1,8 @@
#include <mbgl/programs/debug_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<DebugProgram>> gfx::Context::createProgram(const ProgramParameters&);
} // namespace mbgl

View File

@@ -3,14 +3,13 @@
#include <mbgl/programs/program.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/shaders/debug.hpp>
#include <mbgl/style/properties.hpp>
namespace mbgl {
class DebugProgram : public Program<
shaders::debug,
gfx::Line,
DebugProgram,
gfx::PrimitiveType::Line,
TypeList<
attributes::a_pos>,
TypeList<
@@ -24,6 +23,6 @@ public:
};
using DebugLayoutVertex = DebugProgram::LayoutVertex;
using DebugAttributes = DebugProgram::Attributes;
using DebugAttributes = DebugProgram::AttributeList;
} // namespace mbgl

View File

@@ -1,7 +1,10 @@
#include <mbgl/programs/extrusion_texture_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<ExtrusionTextureProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(ExtrusionTextureLayoutVertex) == 4, "expected ExtrusionTextureLayoutVertex size");
} // namespace mbgl

View File

@@ -4,15 +4,14 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/extrusion_texture.hpp>
#include <mbgl/style/properties.hpp>
#include <mbgl/util/geometry.hpp>
namespace mbgl {
class ExtrusionTextureProgram : public Program<
shaders::extrusion_texture,
gfx::Triangle,
ExtrusionTextureProgram,
gfx::PrimitiveType::Triangle,
TypeList<attributes::a_pos>,
TypeList<
uniforms::u_matrix,
@@ -35,6 +34,6 @@ public:
};
using ExtrusionTextureLayoutVertex = ExtrusionTextureProgram::LayoutVertex;
using ExtrusionTextureAttributes = ExtrusionTextureProgram::Attributes;
using ExtrusionTextureAttributes = ExtrusionTextureProgram::AttributeList;
} // namespace mbgl

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/fill_extrusion_program.hpp>

View File

@@ -1,4 +1,5 @@
#include <mbgl/programs/fill_extrusion_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
#include <mbgl/renderer/image_atlas.hpp>
#include <mbgl/renderer/cross_faded_property_evaluator.hpp>
#include <mbgl/tile/tile_id.hpp>
@@ -7,6 +8,9 @@
namespace mbgl {
template std::unique_ptr<gfx::Program<FillExtrusionProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<FillExtrusionPatternProgram>> gfx::Context::createProgram(const ProgramParameters&);
using namespace style;
static_assert(sizeof(FillExtrusionLayoutVertex) == 12, "expected FillExtrusionLayoutVertex size");
@@ -31,10 +35,8 @@ float lightIntensity(const EvaluatedLight& light) {
return light.get<LightIntensity>();
}
FillExtrusionProgram::UniformValues
FillExtrusionProgram::uniformValues(mat4 matrix,
const TransformState& state,
const EvaluatedLight& light) {
FillExtrusionProgram::LayoutUniformValues FillExtrusionProgram::layoutUniformValues(
mat4 matrix, const TransformState& state, const EvaluatedLight& light) {
return {
uniforms::u_matrix::Value( matrix ),
uniforms::u_lightcolor::Value( lightColor(light) ),
@@ -43,8 +45,8 @@ FillExtrusionProgram::uniformValues(mat4 matrix,
};
}
FillExtrusionPatternProgram::UniformValues
FillExtrusionPatternProgram::uniformValues(mat4 matrix,
FillExtrusionPatternProgram::LayoutUniformValues
FillExtrusionPatternProgram::layoutUniformValues(mat4 matrix,
Size atlasSize,
const CrossfadeParameters& crossfade,
const UnwrappedTileID& tileID,

View File

@@ -5,8 +5,6 @@
#include <mbgl/programs/extrusion_texture_program.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/fill_extrusion.hpp>
#include <mbgl/shaders/fill_extrusion_pattern.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/util/mat4.hpp>
#include <mbgl/util/size.hpp>
@@ -53,8 +51,8 @@ using FillExtrusionPatternUniforms = TypeList<
uniforms::u_lightintensity>;
class FillExtrusionProgram : public Program<
shaders::fill_extrusion,
gfx::Triangle,
FillExtrusionProgram,
gfx::PrimitiveType::Triangle,
FillExtrusionLayoutAttributes,
FillExtrusionUniforms,
TypeList<>,
@@ -83,15 +81,13 @@ public:
};
}
static UniformValues uniformValues(mat4,
const TransformState&,
const EvaluatedLight&);
static LayoutUniformValues
layoutUniformValues(mat4, const TransformState&, const EvaluatedLight&);
};
class FillExtrusionPatternProgram : public Program<
shaders::fill_extrusion_pattern,
gfx::Triangle,
FillExtrusionPatternProgram,
gfx::PrimitiveType::Triangle,
FillExtrusionLayoutAttributes,
FillExtrusionPatternUniforms,
TypeList<
@@ -101,23 +97,23 @@ class FillExtrusionPatternProgram : public Program<
public:
using Program::Program;
static UniformValues uniformValues(mat4,
Size atlasSize,
const CrossfadeParameters&,
const UnwrappedTileID&,
const TransformState&,
const float heightFactor,
const float pixelRatio,
const EvaluatedLight&);
static LayoutUniformValues layoutUniformValues(mat4,
Size atlasSize,
const CrossfadeParameters&,
const UnwrappedTileID&,
const TransformState&,
const float heightFactor,
const float pixelRatio,
const EvaluatedLight&);
};
using FillExtrusionLayoutVertex = FillExtrusionProgram::LayoutVertex;
using FillExtrusionAttributes = FillExtrusionProgram::Attributes;
using FillExtrusionAttributes = FillExtrusionProgram::AttributeList;
class FillExtrusionLayerPrograms final : public LayerTypePrograms {
public:
FillExtrusionLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
FillExtrusionLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: fillExtrusion(context, programParameters),
fillExtrusionPattern(context, programParameters),
extrusionTexture(context, programParameters) {}

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/fill_program.hpp>

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/fill_program.hpp>

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/fill_program.hpp>

View File

@@ -1,4 +1,5 @@
#include <mbgl/programs/fill_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
#include <mbgl/renderer/image_atlas.hpp>
#include <mbgl/renderer/cross_faded_property_evaluator.hpp>
#include <mbgl/tile/tile_id.hpp>
@@ -6,19 +7,23 @@
namespace mbgl {
template std::unique_ptr<gfx::Program<FillProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<FillPatternProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<FillOutlineProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<FillOutlinePatternProgram>> gfx::Context::createProgram(const ProgramParameters&);
using namespace style;
static_assert(sizeof(FillLayoutVertex) == 4, "expected FillLayoutVertex size");
FillPatternProgram::UniformValues
FillPatternProgram::uniformValues(mat4 matrix,
Size framebufferSize,
Size atlasSize,
const CrossfadeParameters& crossfade,
const UnwrappedTileID& tileID,
const TransformState& state,
const float pixelRatio)
{
FillPatternProgram::LayoutUniformValues
FillPatternProgram::layoutUniformValues(mat4 matrix,
Size framebufferSize,
Size atlasSize,
const CrossfadeParameters& crossfade,
const UnwrappedTileID& tileID,
const TransformState& state,
const float pixelRatio) {
const auto tileRatio = 1 / tileID.pixelsToTileUnits(1, state.getIntegerZoom());
int32_t tileSizeAtNearestZoom = util::tileSize * state.zoomScale(state.getIntegerZoom() - tileID.canonical.z);
int32_t pixelX = tileSizeAtNearestZoom * (tileID.canonical.x + tileID.wrap * state.zoomScale(tileID.canonical.z));

View File

@@ -4,10 +4,6 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/fill.hpp>
#include <mbgl/shaders/fill_pattern.hpp>
#include <mbgl/shaders/fill_outline.hpp>
#include <mbgl/shaders/fill_outline_pattern.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/util/mat4.hpp>
#include <mbgl/util/size.hpp>
@@ -38,8 +34,8 @@ using FillPatternUniforms = TypeList<
uniforms::u_pixel_coord_lower>;
class FillProgram : public Program<
shaders::fill,
gfx::Triangle,
FillProgram,
gfx::PrimitiveType::Triangle,
FillLayoutAttributes,
FillUniforms,
TypeList<>,
@@ -59,8 +55,8 @@ public:
};
class FillPatternProgram : public Program<
shaders::fill_pattern,
gfx::Triangle,
FillPatternProgram,
gfx::PrimitiveType::Triangle,
FillLayoutAttributes,
FillPatternUniforms,
TypeList<
@@ -70,18 +66,18 @@ class FillPatternProgram : public Program<
public:
using Program::Program;
static UniformValues uniformValues(mat4 matrix,
Size framebufferSize,
Size atlasSize,
const CrossfadeParameters& crossfade,
const UnwrappedTileID&,
const TransformState&,
const float pixelRatio);
static LayoutUniformValues layoutUniformValues(mat4 matrix,
Size framebufferSize,
Size atlasSize,
const CrossfadeParameters& crossfade,
const UnwrappedTileID&,
const TransformState&,
const float pixelRatio);
};
class FillOutlineProgram : public Program<
shaders::fill_outline,
gfx::Line,
FillOutlineProgram,
gfx::PrimitiveType::Line,
FillLayoutAttributes,
FillUniforms,
TypeList<>,
@@ -92,8 +88,8 @@ public:
};
class FillOutlinePatternProgram : public Program<
shaders::fill_outline_pattern,
gfx::Line,
FillOutlinePatternProgram,
gfx::PrimitiveType::Line,
FillLayoutAttributes,
FillPatternUniforms,
TypeList<
@@ -105,11 +101,11 @@ public:
};
using FillLayoutVertex = FillProgram::LayoutVertex;
using FillAttributes = FillProgram::Attributes;
using FillAttributes = FillProgram::AttributeList;
class FillLayerPrograms final : public LayerTypePrograms {
public:
FillLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
FillLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: fill(context, programParameters),
fillPattern(context, programParameters),
fillOutline(context, programParameters),

View File

@@ -0,0 +1,47 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/programs/background_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace gfx {
template <>
std::unique_ptr<Program<BackgroundProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<BackgroundProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "background",
programs::gl::shaderSource() + 1429, programs::gl::shaderSource() + 1525);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of background.vertex.glsl:
/*
attribute vec2 a_pos;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * vec4(a_pos, 0, 1);
}
*/
// Uncompressed source of background.fragment.glsl:
/*
uniform vec4 u_color;
uniform float u_opacity;
void main() {
gl_FragColor = u_color * u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor = vec4(1.0);
#endif
}
*/

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/background_pattern.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/background_pattern_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* background_pattern::name = "background_pattern";
const char* background_pattern::vertexSource = source() + 1675;
const char* background_pattern::fragmentSource = source() + 2266;
template <>
std::unique_ptr<Program<BackgroundPatternProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<BackgroundPatternProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "background_pattern",
programs::gl::shaderSource() + 1675, programs::gl::shaderSource() + 2266);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of background_pattern.vertex.glsl:
/*
@@ -68,5 +76,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/circle.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/circle_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* circle::name = "circle";
const char* circle::vertexSource = source() + 2927;
const char* circle::fragmentSource = source() + 6093;
template <>
std::unique_ptr<Program<CircleProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<CircleProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "circle",
programs::gl::shaderSource() + 2927, programs::gl::shaderSource() + 6093);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of circle.vertex.glsl:
/*
@@ -290,5 +298,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -0,0 +1,40 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/programs/clipping_mask_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace gfx {
template <>
std::unique_ptr<Program<ClippingMaskProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<ClippingMaskProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "clipping_mask",
programs::gl::shaderSource() + 7848, programs::gl::shaderSource() + 7944);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of clipping_mask.vertex.glsl:
/*
attribute vec2 a_pos;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * vec4(a_pos, 0, 1);
}
*/
// Uncompressed source of clipping_mask.fragment.glsl:
/*
void main() {
gl_FragColor = vec4(1.0);
}
*/

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/collision_box.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/collision_box_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* collision_box::name = "collision_box";
const char* collision_box::vertexSource = source() + 9956;
const char* collision_box::fragmentSource = source() + 10635;
template <>
std::unique_ptr<Program<CollisionBoxProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<CollisionBoxProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "collision_box",
programs::gl::shaderSource() + 9956, programs::gl::shaderSource() + 10635);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of collision_box.vertex.glsl:
/*
@@ -67,5 +75,3 @@ void main() {
}
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/collision_circle.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/collision_circle_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* collision_circle::name = "collision_circle";
const char* collision_circle::vertexSource = source() + 10858;
const char* collision_circle::fragmentSource = source() + 11774;
template <>
std::unique_ptr<Program<CollisionCircleProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<CollisionCircleProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "collision_circle",
programs::gl::shaderSource() + 10858, programs::gl::shaderSource() + 11774);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of collision_circle.vertex.glsl:
/*
@@ -90,5 +98,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -0,0 +1,42 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/programs/debug_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace gfx {
template <>
std::unique_ptr<Program<DebugProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<DebugProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "debug",
programs::gl::shaderSource() + 12450, programs::gl::shaderSource() + 12546);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of debug.vertex.glsl:
/*
attribute vec2 a_pos;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * vec4(a_pos, 0, 1);
}
*/
// Uncompressed source of debug.fragment.glsl:
/*
uniform highp vec4 u_color;
void main() {
gl_FragColor = u_color;
}
*/

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/extrusion_texture.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/extrusion_texture_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* extrusion_texture::name = "extrusion_texture";
const char* extrusion_texture::vertexSource = source() + 27554;
const char* extrusion_texture::fragmentSource = source() + 27734;
template <>
std::unique_ptr<Program<ExtrusionTextureProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<ExtrusionTextureProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "extrusion_texture",
programs::gl::shaderSource() + 27554, programs::gl::shaderSource() + 27734);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of extrusion_texture.vertex.glsl:
/*
@@ -42,5 +50,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/fill.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/fill_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* fill::name = "fill";
const char* fill::vertexSource = source() + 12610;
const char* fill::fragmentSource = source() + 13254;
template <>
std::unique_ptr<Program<FillProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<FillProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "fill",
programs::gl::shaderSource() + 12610, programs::gl::shaderSource() + 13254);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of fill.vertex.glsl:
/*
@@ -94,5 +102,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/fill_extrusion.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/fill_extrusion_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* fill_extrusion::name = "fill_extrusion";
const char* fill_extrusion::vertexSource = source() + 21238;
const char* fill_extrusion::fragmentSource = source() + 23121;
template <>
std::unique_ptr<Program<FillExtrusionProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<FillExtrusionProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "fill_extrusion",
programs::gl::shaderSource() + 21238, programs::gl::shaderSource() + 23121);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of fill_extrusion.vertex.glsl:
/*
@@ -132,5 +140,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/fill_extrusion_pattern.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/fill_extrusion_pattern_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* fill_extrusion_pattern::name = "fill_extrusion_pattern";
const char* fill_extrusion_pattern::vertexSource = source() + 23237;
const char* fill_extrusion_pattern::fragmentSource = source() + 26157;
template <>
std::unique_ptr<Program<FillExtrusionPatternProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<FillExtrusionPatternProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "fill_extrusion_pattern",
programs::gl::shaderSource() + 23237, programs::gl::shaderSource() + 26157);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of fill_extrusion_pattern.vertex.glsl:
/*
@@ -231,5 +239,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/fill_outline.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/fill_outline_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* fill_outline::name = "fill_outline";
const char* fill_outline::vertexSource = source() + 13678;
const char* fill_outline::fragmentSource = source() + 14503;
template <>
std::unique_ptr<Program<FillOutlineProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<FillOutlineProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "fill_outline",
programs::gl::shaderSource() + 13678, programs::gl::shaderSource() + 14503);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of fill_outline.vertex.glsl:
/*
@@ -102,5 +110,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/fill_outline_pattern.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/fill_outline_pattern_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* fill_outline_pattern::name = "fill_outline_pattern";
const char* fill_outline_pattern::vertexSource = source() + 15092;
const char* fill_outline_pattern::fragmentSource = source() + 16952;
template <>
std::unique_ptr<Program<FillOutlinePatternProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<FillOutlinePatternProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "fill_outline_pattern",
programs::gl::shaderSource() + 15092, programs::gl::shaderSource() + 16952);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of fill_outline_pattern.vertex.glsl:
/*
@@ -176,5 +184,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/fill_pattern.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/fill_pattern_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* fill_pattern::name = "fill_pattern";
const char* fill_pattern::vertexSource = source() + 18259;
const char* fill_pattern::fragmentSource = source() + 20038;
template <>
std::unique_ptr<Program<FillPatternProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<FillPatternProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "fill_pattern",
programs::gl::shaderSource() + 18259, programs::gl::shaderSource() + 20038);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of fill_pattern.vertex.glsl:
/*
@@ -164,5 +172,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/heatmap.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/heatmap_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* heatmap::name = "heatmap";
const char* heatmap::vertexSource = source() + 7983;
const char* heatmap::fragmentSource = source() + 9030;
template <>
std::unique_ptr<Program<HeatmapProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<HeatmapProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "heatmap",
programs::gl::shaderSource() + 7983, programs::gl::shaderSource() + 9030);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of heatmap.vertex.glsl:
/*
@@ -131,5 +139,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/heatmap_texture.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/heatmap_texture_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* heatmap_texture::name = "heatmap_texture";
const char* heatmap_texture::vertexSource = source() + 9491;
const char* heatmap_texture::fragmentSource = source() + 9671;
template <>
std::unique_ptr<Program<HeatmapTextureProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<HeatmapTextureProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "heatmap_texture",
programs::gl::shaderSource() + 9491, programs::gl::shaderSource() + 9671);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of heatmap_texture.vertex.glsl:
/*
@@ -45,5 +53,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/hillshade.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/hillshade_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* hillshade::name = "hillshade";
const char* hillshade::vertexSource = source() + 29340;
const char* hillshade::fragmentSource = source() + 29511;
template <>
std::unique_ptr<Program<HillshadeProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<HillshadeProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "hillshade",
programs::gl::shaderSource() + 29340, programs::gl::shaderSource() + 29511);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of hillshade.vertex.glsl:
/*
@@ -83,5 +91,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/hillshade_prepare.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/hillshade_prepare_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* hillshade_prepare::name = "hillshade_prepare";
const char* hillshade_prepare::vertexSource = source() + 27925;
const char* hillshade_prepare::fragmentSource = source() + 28218;
template <>
std::unique_ptr<Program<HillshadePrepareProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<HillshadePrepareProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "hillshade_prepare",
programs::gl::shaderSource() + 27925, programs::gl::shaderSource() + 28218);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of hillshade_prepare.vertex.glsl:
/*
@@ -107,5 +115,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/line.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/line_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* line::name = "line";
const char* line::vertexSource = source() + 30585;
const char* line::fragmentSource = source() + 33509;
template <>
std::unique_ptr<Program<LineProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<LineProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "line",
programs::gl::shaderSource() + 30585, programs::gl::shaderSource() + 33509);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of line.vertex.glsl:
/*
@@ -243,5 +251,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/line_gradient.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/line_gradient_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* line_gradient::name = "line_gradient";
const char* line_gradient::vertexSource = source() + 34335;
const char* line_gradient::fragmentSource = source() + 37054;
template <>
std::unique_ptr<Program<LineGradientProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<LineGradientProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "line_gradient",
programs::gl::shaderSource() + 34335, programs::gl::shaderSource() + 37054);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of line_gradient.vertex.glsl:
/*
@@ -225,5 +233,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/line_pattern.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/line_pattern_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* line_pattern::name = "line_pattern";
const char* line_pattern::vertexSource = source() + 37841;
const char* line_pattern::fragmentSource = source() + 41162;
template <>
std::unique_ptr<Program<LinePatternProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<LinePatternProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "line_pattern",
programs::gl::shaderSource() + 37841, programs::gl::shaderSource() + 41162);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of line_pattern.vertex.glsl:
/*
@@ -312,5 +320,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/line_sdf.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/line_sdf_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* line_sdf::name = "line_sdf";
const char* line_sdf::vertexSource = source() + 43475;
const char* line_sdf::fragmentSource = source() + 47089;
template <>
std::unique_ptr<Program<LineSDFProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<LineSDFProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "line_sdf",
programs::gl::shaderSource() + 43475, programs::gl::shaderSource() + 47089);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of line_sdf.vertex.glsl:
/*
@@ -305,5 +313,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -0,0 +1,15 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/programs/gl/preludes.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
namespace mbgl {
namespace programs {
namespace gl {
const char* vertexShaderPrelude = programs::gl::shaderSource() + 0;
const char* fragmentShaderPrelude = programs::gl::shaderSource() + 1252;
} // namespace gl
} // namespace programs
} // namespace mbgl

View File

@@ -0,0 +1,14 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#pragma once
namespace mbgl {
namespace programs {
namespace gl {
extern const char* vertexShaderPrelude;
extern const char* fragmentShaderPrelude;
} // namespace gl
} // namespace programs
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/raster.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/raster_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* raster::name = "raster";
const char* raster::vertexSource = source() + 48592;
const char* raster::fragmentSource = source() + 48941;
template <>
std::unique_ptr<Program<RasterProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<RasterProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "raster",
programs::gl::shaderSource() + 48592, programs::gl::shaderSource() + 48941);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of raster.vertex.glsl:
/*
@@ -93,5 +101,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -0,0 +1,471 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/util/compression.hpp>
#include <cstdint>
namespace mbgl {
namespace programs {
namespace gl {
constexpr const uint8_t compressedShaderSource[] = {
0x78, 0xda, 0xed, 0x3d, 0xfd, 0x6f, 0xe3, 0x36, 0xb2, 0xf7, 0x73, 0xfe, 0x0a, 0x17, 0x05, 0x0e,
0x92, 0x2c, 0x5b, 0xb6, 0x93, 0xec, 0x97, 0x4e, 0xaf, 0x08, 0x76, 0xb3, 0x7d, 0x01, 0xda, 0xdd,
0x60, 0xd3, 0xf6, 0x15, 0x57, 0x2c, 0x0c, 0xc9, 0x56, 0x6c, 0xdf, 0xd9, 0x96, 0x9f, 0xad, 0x24,
0x76, 0x0e, 0xf9, 0xdf, 0x1f, 0x87, 0xdf, 0xa4, 0x48, 0x59, 0x76, 0x12, 0xe7, 0xe3, 0x19, 0x45,
0x37, 0x16, 0x39, 0x1c, 0x0e, 0xc9, 0xe1, 0x70, 0x66, 0x48, 0x0e, 0x7f, 0x1c, 0x5d, 0xf6, 0xd3,
0xcb, 0xda, 0xcf, 0xbf, 0x74, 0x4f, 0x2f, 0x0e, 0x66, 0xf3, 0xb4, 0x37, 0x5a, 0x8c, 0xb2, 0x69,
0x6d, 0x38, 0x1a, 0x0c, 0x67, 0xb5, 0xcb, 0x71, 0x16, 0xe7, 0xe1, 0xc1, 0x8f, 0xe9, 0x78, 0x91,
0x1e, 0xfc, 0x38, 0xba, 0xac, 0xfd, 0x80, 0x60, 0x47, 0xd3, 0xb4, 0xef, 0x8c, 0xb3, 0x9b, 0x99,
0x7b, 0xf0, 0x23, 0xf9, 0xac, 0xc1, 0x17, 0x82, 0x9a, 0xf6, 0x47, 0x97, 0x2a, 0xd8, 0x24, 0xed,
0x8f, 0xae, 0x26, 0x12, 0x24,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e, 0xf6, 0x55,
0x4b, 0x87, 0x08, 0x81, 0xb4, 0x86, 0x8c, 0xc0, 0x87, 0x94, 0xba, 0x92, 0x52, 0xf1, 0xc4, 0xa0,
0xa7, 0xae, 0x64, 0xf7, 0xf2, 0x65, 0xff, 0x1f, 0x03, 0x90, 0xfe, 0x1c
};
const char* shaderSource() {
static std::string decompressed = util::decompress(std::string(reinterpret_cast<const char*>(compressedShaderSource), sizeof(compressedShaderSource)));
return decompressed.c_str();
};
} // namespace gl
} // namespace programs
} // namespace mbgl

View File

@@ -3,9 +3,11 @@
#pragma once
namespace mbgl {
namespace shaders {
namespace programs {
namespace gl {
const char* source();
const char* shaderSource();
} // namespace shaders
} // namespace gl
} // namespace programs
} // namespace mbgl

View File

@@ -1,19 +1,20 @@
#include <mbgl/shaders/shaders.hpp>
#include <mbgl/shaders/preludes.hpp>
#include <mbgl/programs/gl/shaders.hpp>
#include <mbgl/programs/gl/preludes.hpp>
#include <mbgl/programs/program_parameters.hpp>
#include <mbgl/util/string.hpp>
#include <cassert>
namespace mbgl {
namespace shaders {
namespace programs {
namespace gl {
std::string fragmentSource(const ProgramParameters& parameters, const char* fragmentSource) {
return parameters.getDefines() + fragmentPrelude + fragmentSource;
return parameters.getDefines() + fragmentShaderPrelude + fragmentSource;
}
std::string vertexSource(const ProgramParameters& parameters, const char* vertexSource) {
return parameters.getDefines() + vertexPrelude + vertexSource;
return parameters.getDefines() + vertexShaderPrelude + vertexSource;
}
std::string programIdentifier(const std::string& vertexSource, const std::string& fragmentSource) {
@@ -25,5 +26,6 @@ std::string programIdentifier(const std::string& vertexSource, const std::string
return result;
}
} // namespace shaders
} // namespace gl
} // namespace programs
} // namespace mbgl

View File

@@ -6,11 +6,13 @@ namespace mbgl {
class ProgramParameters;
namespace shaders {
namespace programs {
namespace gl {
std::string fragmentSource(const ProgramParameters&, const char* fragmentSource);
std::string vertexSource(const ProgramParameters&, const char* vertexSource);
std::string programIdentifier(const std::string& vertexSource, const std::string& fragmentSource);
} // namespace shaders
} // namespace gl
} // namespace programs
} // namespace mbgl

View File

@@ -1,14 +1,22 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/symbol_icon.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/symbol_icon_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* symbol_icon::name = "symbol_icon";
const char* symbol_icon::vertexSource = source() + 50000;
const char* symbol_icon::fragmentSource = source() + 52654;
template <>
std::unique_ptr<Program<SymbolIconProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<SymbolIconProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "symbol_icon",
programs::gl::shaderSource() + 50000, programs::gl::shaderSource() + 52654);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of symbol_icon.vertex.glsl:
/*
@@ -152,5 +160,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -1,16 +1,24 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/shaders/symbol_sdf.hpp>
#include <mbgl/shaders/source.hpp>
#include <mbgl/programs/symbol_sdf_icon_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace shaders {
namespace gfx {
const char* symbol_sdf::name = "symbol_sdf";
const char* symbol_sdf::vertexSource = source() + 53059;
const char* symbol_sdf::fragmentSource = source() + 57099;
template <>
std::unique_ptr<Program<SymbolSDFIconProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<SymbolSDFIconProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "symbol_sdf_icon",
programs::gl::shaderSource() + 53059, programs::gl::shaderSource() + 57099);
}
// Uncompressed source of symbol_sdf.vertex.glsl:
} // namespace gfx
} // namespace mbgl
// Uncompressed source of symbol_sdf_icon.vertex.glsl:
/*
const float PI = 3.141592653589793;
@@ -202,7 +210,7 @@ void main() {
*/
// Uncompressed source of symbol_sdf.fragment.glsl:
// Uncompressed source of symbol_sdf_icon.fragment.glsl:
/*
#define SDF_PX 8.0
#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO
@@ -307,5 +315,3 @@ void main() {
*/
} // namespace shaders
} // namespace mbgl

View File

@@ -0,0 +1,317 @@
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/programs/symbol_sdf_text_program.hpp>
#include <mbgl/programs/gl/shader_source.hpp>
#include <mbgl/gl/program.hpp>
namespace mbgl {
namespace gfx {
template <>
std::unique_ptr<Program<SymbolSDFTextProgram>>
Context::createProgram<gl::Context>(const ProgramParameters& programParameters) {
return gl::Program<SymbolSDFTextProgram>::createProgram(
reinterpret_cast<gl::Context&>(*this), programParameters, "symbol_sdf_text",
programs::gl::shaderSource() + 53059, programs::gl::shaderSource() + 57099);
}
} // namespace gfx
} // namespace mbgl
// Uncompressed source of symbol_sdf_text.vertex.glsl:
/*
const float PI = 3.141592653589793;
attribute vec4 a_pos_offset;
attribute vec4 a_data;
attribute vec3 a_projected_pos;
attribute float a_fade_opacity;
// contents of a_size vary based on the type of property value
// used for {text,icon}-size.
// For constants, a_size is disabled.
// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.
// For composite functions:
// [ text-size(lowerZoomStop, feature),
// text-size(upperZoomStop, feature) ]
uniform bool u_is_size_zoom_constant;
uniform bool u_is_size_feature_constant;
uniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function
uniform highp float u_size; // used when size is both zoom and feature constant
#ifndef HAS_UNIFORM_u_fill_color
uniform lowp float a_fill_color_t;
attribute highp vec4 a_fill_color;
varying highp vec4 fill_color;
#else
uniform highp vec4 u_fill_color;
#endif
#ifndef HAS_UNIFORM_u_halo_color
uniform lowp float a_halo_color_t;
attribute highp vec4 a_halo_color;
varying highp vec4 halo_color;
#else
uniform highp vec4 u_halo_color;
#endif
#ifndef HAS_UNIFORM_u_opacity
uniform lowp float a_opacity_t;
attribute lowp vec2 a_opacity;
varying lowp float opacity;
#else
uniform lowp float u_opacity;
#endif
#ifndef HAS_UNIFORM_u_halo_width
uniform lowp float a_halo_width_t;
attribute lowp vec2 a_halo_width;
varying lowp float halo_width;
#else
uniform lowp float u_halo_width;
#endif
#ifndef HAS_UNIFORM_u_halo_blur
uniform lowp float a_halo_blur_t;
attribute lowp vec2 a_halo_blur;
varying lowp float halo_blur;
#else
uniform lowp float u_halo_blur;
#endif
uniform mat4 u_matrix;
uniform mat4 u_label_plane_matrix;
uniform mat4 u_gl_coord_matrix;
uniform bool u_is_text;
uniform bool u_pitch_with_map;
uniform highp float u_pitch;
uniform bool u_rotate_symbol;
uniform highp float u_aspect_ratio;
uniform highp float u_camera_to_center_distance;
uniform float u_fade_change;
uniform vec2 u_texsize;
varying vec2 v_data0;
varying vec3 v_data1;
void main() {
#ifndef HAS_UNIFORM_u_fill_color
fill_color = unpack_mix_color(a_fill_color, a_fill_color_t);
#else
highp vec4 fill_color = u_fill_color;
#endif
#ifndef HAS_UNIFORM_u_halo_color
halo_color = unpack_mix_color(a_halo_color, a_halo_color_t);
#else
highp vec4 halo_color = u_halo_color;
#endif
#ifndef HAS_UNIFORM_u_opacity
opacity = unpack_mix_vec2(a_opacity, a_opacity_t);
#else
lowp float opacity = u_opacity;
#endif
#ifndef HAS_UNIFORM_u_halo_width
halo_width = unpack_mix_vec2(a_halo_width, a_halo_width_t);
#else
lowp float halo_width = u_halo_width;
#endif
#ifndef HAS_UNIFORM_u_halo_blur
halo_blur = unpack_mix_vec2(a_halo_blur, a_halo_blur_t);
#else
lowp float halo_blur = u_halo_blur;
#endif
vec2 a_pos = a_pos_offset.xy;
vec2 a_offset = a_pos_offset.zw;
vec2 a_tex = a_data.xy;
vec2 a_size = a_data.zw;
highp float segment_angle = -a_projected_pos[2];
float size;
if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {
size = mix(a_size[0], a_size[1], u_size_t) / 256.0;
} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {
size = a_size[0] / 256.0;
} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {
size = u_size;
} else {
size = u_size;
}
vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);
highp float camera_to_anchor_distance = projectedPoint.w;
// If the label is pitched with the map, layout is done in pitched space,
// which makes labels in the distance smaller relative to viewport space.
// We counteract part of that effect by multiplying by the perspective ratio.
// If the label isn't pitched with the map, we do layout in viewport space,
// which makes labels in the distance larger relative to the features around
// them. We counteract part of that effect by dividing by the perspective ratio.
highp float distance_ratio = u_pitch_with_map ?
camera_to_anchor_distance / u_camera_to_center_distance :
u_camera_to_center_distance / camera_to_anchor_distance;
highp float perspective_ratio = clamp(
0.5 + 0.5 * distance_ratio,
0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles
4.0);
size *= perspective_ratio;
float fontScale = u_is_text ? size / 24.0 : size;
highp float symbol_rotation = 0.0;
if (u_rotate_symbol) {
// Point labels with 'rotation-alignment: map' are horizontal with respect to tile units
// To figure out that angle in projected space, we draw a short horizontal line in tile
// space, project it, and measure its angle in projected space.
vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);
vec2 a = projectedPoint.xy / projectedPoint.w;
vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;
symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);
}
highp float angle_sin = sin(segment_angle + symbol_rotation);
highp float angle_cos = cos(segment_angle + symbol_rotation);
mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);
vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);
gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);
float gamma_scale = gl_Position.w;
vec2 tex = a_tex / u_texsize;
vec2 fade_opacity = unpack_opacity(a_fade_opacity);
float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;
float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));
v_data0 = vec2(tex.x, tex.y);
v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);
}
*/
// Uncompressed source of symbol_sdf_text.fragment.glsl:
/*
#define SDF_PX 8.0
#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO
uniform bool u_is_halo;
#ifndef HAS_UNIFORM_u_fill_color
varying highp vec4 fill_color;
#else
uniform highp vec4 u_fill_color;
#endif
#ifndef HAS_UNIFORM_u_halo_color
varying highp vec4 halo_color;
#else
uniform highp vec4 u_halo_color;
#endif
#ifndef HAS_UNIFORM_u_opacity
varying lowp float opacity;
#else
uniform lowp float u_opacity;
#endif
#ifndef HAS_UNIFORM_u_halo_width
varying lowp float halo_width;
#else
uniform lowp float u_halo_width;
#endif
#ifndef HAS_UNIFORM_u_halo_blur
varying lowp float halo_blur;
#else
uniform lowp float u_halo_blur;
#endif
uniform sampler2D u_texture;
uniform highp float u_gamma_scale;
uniform bool u_is_text;
varying vec2 v_data0;
varying vec3 v_data1;
void main() {
#ifdef HAS_UNIFORM_u_fill_color
highp vec4 fill_color = u_fill_color;
#endif
#ifdef HAS_UNIFORM_u_halo_color
highp vec4 halo_color = u_halo_color;
#endif
#ifdef HAS_UNIFORM_u_opacity
lowp float opacity = u_opacity;
#endif
#ifdef HAS_UNIFORM_u_halo_width
lowp float halo_width = u_halo_width;
#endif
#ifdef HAS_UNIFORM_u_halo_blur
lowp float halo_blur = u_halo_blur;
#endif
vec2 tex = v_data0.xy;
float gamma_scale = v_data1.x;
float size = v_data1.y;
float fade_opacity = v_data1[2];
float fontScale = u_is_text ? size / 24.0 : size;
lowp vec4 color = fill_color;
highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);
lowp float buff = (256.0 - 64.0) / 256.0;
if (u_is_halo) {
color = halo_color;
gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);
buff = (6.0 - halo_width / fontScale) / SDF_PX;
}
lowp float dist = texture2D(u_texture, tex).a;
highp float gamma_scaled = gamma * gamma_scale;
highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
gl_FragColor = color * (alpha * opacity * fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor = vec4(1.0);
#endif
}
*/

View File

@@ -1,7 +1,10 @@
#include <mbgl/programs/heatmap_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<HeatmapProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(HeatmapLayoutVertex) == 4, "expected HeatmapLayoutVertex size");
} // namespace mbgl

View File

@@ -4,7 +4,6 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/heatmap_texture_program.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/shaders/heatmap.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/style/layers/heatmap_layer_properties.hpp>
@@ -15,8 +14,8 @@ MBGL_DEFINE_UNIFORM_SCALAR(float, u_intensity);
} // namespace uniforms
class HeatmapProgram : public Program<
shaders::heatmap,
gfx::Triangle,
HeatmapProgram,
gfx::PrimitiveType::Triangle,
TypeList<
attributes::a_pos>,
TypeList<
@@ -46,11 +45,11 @@ public:
};
using HeatmapLayoutVertex = HeatmapProgram::LayoutVertex;
using HeatmapAttributes = HeatmapProgram::Attributes;
using HeatmapAttributes = HeatmapProgram::AttributeList;
class HeatmapLayerPrograms final : public LayerTypePrograms {
public:
HeatmapLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
HeatmapLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: heatmap(context, programParameters),
heatmapTexture(context, programParameters) {}
ProgramMap<HeatmapProgram> heatmap;

View File

@@ -1,7 +1,10 @@
#include <mbgl/programs/heatmap_texture_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<HeatmapTextureProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(HeatmapTextureLayoutVertex) == 4, "expected HeatmapTextureLayoutVertex size");
} // namespace mbgl

View File

@@ -4,15 +4,14 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/heatmap_texture.hpp>
#include <mbgl/style/properties.hpp>
#include <mbgl/util/geometry.hpp>
namespace mbgl {
class HeatmapTextureProgram : public Program<
shaders::heatmap_texture,
gfx::Triangle,
HeatmapTextureProgram,
gfx::PrimitiveType::Triangle,
TypeList<attributes::a_pos>,
TypeList<
uniforms::u_matrix,
@@ -36,6 +35,6 @@ public:
};
using HeatmapTextureLayoutVertex = HeatmapTextureProgram::LayoutVertex;
using HeatmapTextureAttributes = HeatmapTextureProgram::Attributes;
using HeatmapTextureAttributes = HeatmapTextureProgram::AttributeList;
} // namespace mbgl

View File

@@ -1,7 +1,10 @@
#include <mbgl/programs/hillshade_prepare_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<HillshadePrepareProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(HillshadePrepareLayoutVertex) == 8, "expected HillshadeLayoutVertex size");
} // namespace mbgl

View File

@@ -4,7 +4,6 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/hillshade_prepare.hpp>
#include <mbgl/util/geometry.hpp>
namespace mbgl {
@@ -15,8 +14,8 @@ MBGL_DEFINE_UNIFORM_SCALAR(float, u_maxzoom);
} // namespace uniforms
class HillshadePrepareProgram : public Program<
shaders::hillshade_prepare,
gfx::Triangle,
HillshadePrepareProgram,
gfx::PrimitiveType::Triangle,
TypeList<
attributes::a_pos,
attributes::a_texture_pos>,
@@ -46,6 +45,6 @@ public:
};
using HillshadePrepareLayoutVertex = HillshadePrepareProgram::LayoutVertex;
using HillshadePrepareAttributes = HillshadePrepareProgram::Attributes;
using HillshadePrepareAttributes = HillshadePrepareProgram::AttributeList;
} // namespace mbgl

View File

@@ -1,7 +1,10 @@
#include <mbgl/programs/hillshade_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<HillshadeProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(HillshadeLayoutVertex) == 8, "expected HillshadeLayoutVertex size");
} // namespace mbgl

View File

@@ -5,7 +5,6 @@
#include <mbgl/programs/hillshade_prepare_program.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/hillshade.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/style/layers/hillshade_layer_properties.hpp>
@@ -20,8 +19,8 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_latrange);
} // namespace uniforms
class HillshadeProgram : public Program<
shaders::hillshade,
gfx::Triangle,
HillshadeProgram,
gfx::PrimitiveType::Triangle,
TypeList<
attributes::a_pos,
attributes::a_texture_pos>,
@@ -53,11 +52,11 @@ public:
};
using HillshadeLayoutVertex = HillshadeProgram::LayoutVertex;
using HillshadeAttributes = HillshadeProgram::Attributes;
using HillshadeAttributes = HillshadeProgram::AttributeList;
class HillshadeLayerPrograms final : public LayerTypePrograms {
public:
HillshadeLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
HillshadeLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: hillshade(context, programParameters),
hillshadePrepare(context, programParameters) {}
HillshadeProgram hillshade;

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/line_program.hpp>

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/line_program.hpp>

View File

@@ -1,4 +1,5 @@
#include <mbgl/programs/line_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
#include <mbgl/style/layers/line_layer_properties.hpp>
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/renderer/image_atlas.hpp>
@@ -8,6 +9,11 @@
namespace mbgl {
template std::unique_ptr<gfx::Program<LineProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<LinePatternProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<LineGradientProgram>> gfx::Context::createProgram(const ProgramParameters&);
template std::unique_ptr<gfx::Program<LineSDFProgram>> gfx::Context::createProgram(const ProgramParameters&);
using namespace style;
static_assert(sizeof(LineLayoutVertex) == 12, "expected LineLayoutVertex size");
@@ -31,12 +37,12 @@ Values makeValues(const RenderLinePaintProperties::PossiblyEvaluated& properties
};
}
LineProgram::UniformValues
LineProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvaluated& properties,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits) {
return makeValues<LineProgram::UniformValues>(
LineProgram::LayoutUniformValues
LineProgram::layoutUniformValues(const RenderLinePaintProperties::PossiblyEvaluated& properties,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits) {
return makeValues<LineProgram::LayoutUniformValues>(
properties,
tile,
state,
@@ -44,16 +50,16 @@ LineProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvaluated& p
);
}
LineSDFProgram::UniformValues
LineSDFProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvaluated& properties,
float pixelRatio,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits,
const LinePatternPos& posA,
const LinePatternPos& posB,
const CrossfadeParameters& crossfade,
float atlasWidth) {
LineSDFProgram::LayoutUniformValues
LineSDFProgram::layoutUniformValues(const RenderLinePaintProperties::PossiblyEvaluated& properties,
float pixelRatio,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits,
const LinePatternPos& posA,
const LinePatternPos& posB,
const CrossfadeParameters& crossfade,
float atlasWidth) {
const float widthA = posA.width * crossfade.fromScale;
const float widthB = posB.width * crossfade.toScale;
@@ -67,7 +73,7 @@ LineSDFProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvaluated
-posB.height / 2.0f
}};
return makeValues<LineSDFProgram::UniformValues>(
return makeValues<LineSDFProgram::LayoutUniformValues>(
properties,
tile,
state,
@@ -81,18 +87,18 @@ LineSDFProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvaluated
);
}
LinePatternProgram::UniformValues
LinePatternProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvaluated& properties,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits,
const Size atlasSize,
const CrossfadeParameters& crossfade,
const float pixelRatio) {
LinePatternProgram::LayoutUniformValues LinePatternProgram::layoutUniformValues(
const RenderLinePaintProperties::PossiblyEvaluated& properties,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits,
const Size atlasSize,
const CrossfadeParameters& crossfade,
const float pixelRatio) {
const auto tileRatio = 1 / tile.id.pixelsToTileUnits(1, state.getIntegerZoom());
return makeValues<LinePatternProgram::UniformValues>(
return makeValues<LinePatternProgram::LayoutUniformValues>(
properties,
tile,
state,
@@ -103,12 +109,12 @@ LinePatternProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvalu
);
}
LineGradientProgram::UniformValues
LineGradientProgram::uniformValues(const RenderLinePaintProperties::PossiblyEvaluated& properties,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits) {
return makeValues<LineGradientProgram::UniformValues>(
LineGradientProgram::LayoutUniformValues LineGradientProgram::layoutUniformValues(
const RenderLinePaintProperties::PossiblyEvaluated& properties,
const RenderTile& tile,
const TransformState& state,
const std::array<float, 2>& pixelsToGLUnits) {
return makeValues<LineGradientProgram::LayoutUniformValues>(
properties,
tile,
state,

View File

@@ -4,10 +4,6 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/line.hpp>
#include <mbgl/shaders/line_gradient.hpp>
#include <mbgl/shaders/line_pattern.hpp>
#include <mbgl/shaders/line_sdf.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/renderer/layers/render_line_layer.hpp>
#include <mbgl/renderer/cross_faded_property_evaluator.hpp>
@@ -35,8 +31,8 @@ using LineLayoutAttributes = TypeList<
attributes::a_data<uint8_t, 4>>;
class LineProgram : public Program<
shaders::line,
gfx::Triangle,
LineProgram,
gfx::PrimitiveType::Triangle,
LineLayoutAttributes,
TypeList<
uniforms::u_matrix,
@@ -93,15 +89,16 @@ public:
*/
static const int8_t extrudeScale = 63;
static UniformValues uniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits);
static LayoutUniformValues
layoutUniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits);
};
class LinePatternProgram : public Program<
shaders::line_pattern,
gfx::Triangle,
LinePatternProgram,
gfx::PrimitiveType::Triangle,
LineLayoutAttributes,
TypeList<
uniforms::u_matrix,
@@ -117,18 +114,19 @@ class LinePatternProgram : public Program<
public:
using Program::Program;
static UniformValues uniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits,
Size atlasSize,
const CrossfadeParameters& crossfade,
const float pixelRatio);
static LayoutUniformValues
layoutUniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits,
Size atlasSize,
const CrossfadeParameters& crossfade,
const float pixelRatio);
};
class LineSDFProgram : public Program<
shaders::line_sdf,
gfx::Triangle,
LineSDFProgram,
gfx::PrimitiveType::Triangle,
LineLayoutAttributes,
TypeList<
uniforms::u_matrix,
@@ -147,20 +145,21 @@ class LineSDFProgram : public Program<
public:
using Program::Program;
static UniformValues uniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
float pixelRatio,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits,
const LinePatternPos& posA,
const LinePatternPos& posB,
const CrossfadeParameters& crossfade,
float atlasWidth);
static LayoutUniformValues
layoutUniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
float pixelRatio,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits,
const LinePatternPos& posA,
const LinePatternPos& posB,
const CrossfadeParameters& crossfade,
float atlasWidth);
};
class LineGradientProgram : public Program<
shaders::line_gradient,
gfx::Triangle,
LineGradientProgram,
gfx::PrimitiveType::Triangle,
LineLayoutAttributes,
TypeList<
uniforms::u_matrix,
@@ -173,18 +172,19 @@ class LineGradientProgram : public Program<
public:
using Program::Program;
static UniformValues uniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits);
static LayoutUniformValues
layoutUniformValues(const RenderLinePaintProperties::PossiblyEvaluated&,
const RenderTile&,
const TransformState&,
const std::array<float, 2>& pixelsToGLUnits);
};
using LineLayoutVertex = LineProgram::LayoutVertex;
using LineAttributes = LineProgram::Attributes;
using LineAttributes = LineProgram::AttributeList;
class LineLayerPrograms final : public LayerTypePrograms {
public:
LineLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
LineLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: line(context, programParameters),
lineGradient(context, programParameters),
lineSDF(context, programParameters),

View File

@@ -0,0 +1,4 @@
#pragma once
// Alias
#include <mbgl/programs/line_program.hpp>

View File

@@ -1,106 +1,106 @@
#pragma once
#include <mbgl/gl/program.hpp>
#include <mbgl/gl/features.hpp>
#include <mbgl/gfx/attribute.hpp>
#include <mbgl/gfx/uniform.hpp>
#include <mbgl/programs/segment.hpp>
#include <mbgl/programs/binary_program.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/program_parameters.hpp>
#include <mbgl/style/paint_property.hpp>
#include <mbgl/renderer/paint_property_binder.hpp>
#include <mbgl/shaders/shaders.hpp>
#include <mbgl/util/io.hpp>
#include <unordered_map>
namespace mbgl {
template <class Shaders,
class Primitive,
template <class Name,
gfx::PrimitiveType Primitive,
class LayoutAttributeList,
class UniformList,
class TextureList,
class LayoutUniformList,
class Textures,
class PaintProps>
class Program {
public:
using LayoutAttributes = gl::Attributes<LayoutAttributeList>;
using LayoutVertex = gfx::Vertex<LayoutAttributeList>;
using PaintProperties = PaintProps;
using Binders = PaintPropertyBinders<typename PaintProperties::DataDrivenProperties>;
using PaintAttributeList = typename Binders::AttributeList;
using Attributes = gl::Attributes<TypeListConcat<LayoutAttributeList, PaintAttributeList>>;
using AttributeList = TypeListConcat<LayoutAttributeList, PaintAttributeList>;
using AttributeBindings = gfx::AttributeBindings<AttributeList>;
using UniformValues = gfx::UniformValues<UniformList>;
using PaintUniformList = typename Binders::UniformList;
using AllUniforms = gl::Uniforms<TypeListConcat<UniformList, PaintUniformList>>;
using UniformList = TypeListConcat<LayoutUniformList, PaintUniformList>;
using LayoutUniformValues = gfx::UniformValues<LayoutUniformList>;
using UniformValues = gfx::UniformValues<UniformList>;
using TextureList = Textures;
using TextureBindings = gfx::TextureBindings<TextureList>;
using ProgramType = gl::Program<Primitive, Attributes, AllUniforms, TextureList>;
std::unique_ptr<gfx::Program<Name>> program;
ProgramType program;
Program(gl::Context& context, const ProgramParameters& programParameters)
: program(ProgramType::createProgram(
context,
programParameters,
Shaders::name,
Shaders::vertexSource,
Shaders::fragmentSource)) {
Program(gfx::Context& context, const ProgramParameters& programParameters)
: program(context.createProgram<Name>(programParameters)) {
}
static typename AllUniforms::Values computeAllUniformValues(
const UniformValues& uniformValues,
static UniformValues computeAllUniformValues(
const LayoutUniformValues& layoutUniformValues,
const Binders& paintPropertyBinders,
const typename PaintProperties::PossiblyEvaluated& currentProperties,
float currentZoom) {
return uniformValues
return layoutUniformValues
.concat(paintPropertyBinders.uniformValues(currentZoom, currentProperties));
}
static typename Attributes::Bindings computeAllAttributeBindings(
static AttributeBindings computeAllAttributeBindings(
const gfx::VertexBuffer<LayoutVertex>& layoutVertexBuffer,
const Binders& paintPropertyBinders,
const typename PaintProperties::PossiblyEvaluated& currentProperties) {
return LayoutAttributes::bindings(layoutVertexBuffer)
return gfx::AttributeBindings<LayoutAttributeList>(layoutVertexBuffer)
.concat(paintPropertyBinders.attributeBindings(currentProperties));
}
static uint32_t activeBindingCount(const typename Attributes::Bindings& allAttributeBindings) {
return Attributes::activeBindingCount(allAttributeBindings);
static uint32_t activeBindingCount(const AttributeBindings& allAttributeBindings) {
return allAttributeBindings.activeCount();
}
template <class DrawMode>
void draw(gl::Context& context,
DrawMode drawMode,
gfx::DepthMode depthMode,
gfx::StencilMode stencilMode,
gfx::ColorMode colorMode,
gfx::CullFaceMode cullFaceMode,
void draw(gfx::Context& context,
const DrawMode& drawMode,
const gfx::DepthMode& depthMode,
const gfx::StencilMode& stencilMode,
const gfx::ColorMode& colorMode,
const gfx::CullFaceMode& cullFaceMode,
const gfx::IndexBuffer& indexBuffer,
const SegmentVector<Attributes>& segments,
const typename AllUniforms::Values& allUniformValues,
const typename Attributes::Bindings& allAttributeBindings,
const SegmentVector<AttributeList>& segments,
const UniformValues& uniformValues,
const AttributeBindings& allAttributeBindings,
const TextureBindings& textureBindings,
const std::string& layerID) {
for (auto& segment : segments) {
auto vertexArrayIt = segment.vertexArrays.find(layerID);
static_assert(Primitive == gfx::PrimitiveTypeOf<DrawMode>::value, "incompatible draw mode");
if (vertexArrayIt == segment.vertexArrays.end()) {
vertexArrayIt = segment.vertexArrays.emplace(layerID, context.createVertexArray()).first;
if (!program) {
return;
}
for (auto& segment : segments) {
auto drawScopeIt = segment.drawScopes.find(layerID);
if (drawScopeIt == segment.drawScopes.end()) {
drawScopeIt = segment.drawScopes.emplace(layerID, context.createDrawScope()).first;
}
program.draw(
program->draw(
context,
std::move(drawMode),
std::move(depthMode),
std::move(stencilMode),
std::move(colorMode),
std::move(cullFaceMode),
allUniformValues,
vertexArrayIt->second,
Attributes::offsetBindings(allAttributeBindings, segment.vertexOffset),
drawMode,
depthMode,
stencilMode,
colorMode,
cullFaceMode,
uniformValues,
drawScopeIt->second,
allAttributeBindings.offset(segment.vertexOffset),
textureBindings,
indexBuffer,
segment.indexOffset,
@@ -116,7 +116,7 @@ public:
using Binders = typename Program::Binders;
using Bitset = typename Binders::Bitset;
ProgramMap(gl::Context& context_, ProgramParameters parameters_)
ProgramMap(gfx::Context& context_, ProgramParameters parameters_)
: context(context_),
parameters(std::move(parameters_)) {
}
@@ -134,7 +134,7 @@ public:
}
private:
gl::Context& context;
gfx::Context& context;
ProgramParameters parameters;
std::unordered_map<Bitset, Program> programs;
};

View File

@@ -12,7 +12,7 @@
namespace mbgl {
Programs::Programs(gl::Context& context_, const ProgramParameters& programParameters_)
Programs::Programs(gfx::Context& context_, const ProgramParameters& programParameters_)
: debug(context_, programParameters_),
clippingMask(context_, programParameters_),
context(context_),

View File

@@ -20,7 +20,7 @@ class SymbolLayerPrograms;
class Programs {
public:
Programs(gl::Context&, const ProgramParameters&);
Programs(gfx::Context&, const ProgramParameters&);
~Programs();
BackgroundLayerPrograms& getBackgroundLayerPrograms() noexcept;
@@ -47,7 +47,7 @@ private:
std::unique_ptr<LayerTypePrograms> linePrograms;
std::unique_ptr<LayerTypePrograms> symbolPrograms;
gl::Context& context;
gfx::Context& context;
ProgramParameters programParameters;
};

View File

@@ -1,7 +1,10 @@
#include <mbgl/programs/raster_program.hpp>
#include <mbgl/gfx/context_impl.hpp>
namespace mbgl {
template std::unique_ptr<gfx::Program<RasterProgram>> gfx::Context::createProgram(const ProgramParameters&);
static_assert(sizeof(RasterLayoutVertex) == 8, "expected RasterLayoutVertex size");
} // namespace mbgl

View File

@@ -4,7 +4,6 @@
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>
#include <mbgl/programs/textures.hpp>
#include <mbgl/shaders/raster.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/style/layers/raster_layer_properties.hpp>
@@ -23,8 +22,8 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_tl_parent);
} // namespace uniforms
class RasterProgram : public Program<
shaders::raster,
gfx::Triangle,
RasterProgram,
gfx::PrimitiveType::Triangle,
TypeList<
attributes::a_pos,
attributes::a_texture_pos>,
@@ -63,11 +62,11 @@ public:
};
using RasterLayoutVertex = RasterProgram::LayoutVertex;
using RasterAttributes = RasterProgram::Attributes;
using RasterAttributes = RasterProgram::AttributeList;
class RasterLayerPrograms final : public LayerTypePrograms {
public:
RasterLayerPrograms(gl::Context& context, const ProgramParameters& programParameters)
RasterLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters)
: raster(context, programParameters) {}
RasterProgram raster;
};

View File

@@ -1,6 +1,6 @@
#pragma once
#include <mbgl/gl/vertex_array.hpp>
#include <mbgl/gfx/draw_scope.hpp>
#include <cstddef>
#include <vector>
@@ -8,7 +8,7 @@
namespace mbgl {
template <class Attributes>
template <class AttributeList>
class Segment {
public:
Segment(std::size_t vertexOffset_,
@@ -28,17 +28,17 @@ public:
std::size_t vertexLength;
std::size_t indexLength;
// One VertexArray per layer ID. This minimizes rebinding in cases where
// One DrawScope per layer ID. This minimizes rebinding in cases where
// several layers share buckets but have different sets of active attributes.
// This can happen:
// * when two layers have the same layout properties, but differing
// data-driven paint properties
// * when two fill layers have the same layout properties, but one
// uses fill-color and the other uses fill-pattern
mutable std::map<std::string, gl::VertexArray> vertexArrays;
mutable std::map<std::string, gfx::DrawScope> drawScopes;
};
template <class Attributes>
using SegmentVector = std::vector<Segment<Attributes>>;
template <class AttributeList>
using SegmentVector = std::vector<Segment<AttributeList>>;
} // namespace mbgl

Some files were not shown because too many files have changed in this diff Show More