summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/render_static_data.hpp
blob: ddf52f83f6f243ae4d6744215ad4e9eb043a53fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once

#include <mbgl/gfx/vertex_buffer.hpp>
#include <mbgl/gfx/index_buffer.hpp>
#include <mbgl/gfx/renderbuffer.hpp>
#include <mbgl/programs/background_program.hpp>
#include <mbgl/programs/heatmap_texture_program.hpp>
#include <mbgl/programs/programs.hpp>
#include <mbgl/programs/raster_program.hpp>
#include <mbgl/util/optional.hpp>

#include <string>

namespace mbgl {
namespace gfx {
class Context;
} // namespace gfx

class RenderStaticData {
public:
    RenderStaticData(gfx::Context&, float pixelRatio, const optional<std::string>& programCacheDir);

    gfx::VertexBuffer<gfx::Vertex<PositionOnlyLayoutAttributes>> tileVertexBuffer;
    gfx::VertexBuffer<RasterLayoutVertex> rasterVertexBuffer;
    gfx::VertexBuffer<HeatmapTextureLayoutVertex> heatmapTextureVertexBuffer;

    gfx::IndexBuffer quadTriangleIndexBuffer;
    gfx::IndexBuffer tileBorderIndexBuffer;

    SegmentVector<BackgroundAttributes> tileTriangleSegments;
    SegmentVector<DebugAttributes> tileBorderSegments;
    SegmentVector<RasterAttributes> rasterSegments;
    SegmentVector<HeatmapTextureAttributes> heatmapTextureSegments;

    optional<gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>> depthRenderbuffer;
    bool has3D = false;
    Size backendSize;

    Programs programs;

#ifndef NDEBUG
    Programs overdrawPrograms;
#endif
};

} // namespace mbgl