This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Template on shader types, rather than count. This allows the compiler to enforce using the correct VAO for the shader and PaintMode. This fixes OverdrawMode with circle layers. While here, avoid using unique_ptrs for groups. Instead, ensure ElementGroup is movable.
- Loading branch information
1 parent
8d4362d
commit 39c4cb0
Showing
16 changed files
with
152 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include <mbgl/gl/vao.hpp> | ||
#include <mbgl/renderer/render_pass.hpp> | ||
|
||
namespace mbgl { | ||
|
||
template <class... Shaders> | ||
struct ElementGroup { | ||
template <class Shader> | ||
struct VAOs { | ||
gl::VertexArrayObject normalVAO; | ||
gl::VertexArrayObject overdrawVAO; | ||
}; | ||
|
||
std::tuple<VAOs<Shaders>...> vaos; | ||
|
||
template <class Shader> | ||
gl::VertexArrayObject& getVAO(const Shader&, PaintMode paintMode) { | ||
auto& vao = std::get<VAOs<Shader>>(vaos); | ||
return paintMode == PaintMode::Overdraw ? vao.overdrawVAO : vao.normalVAO; | ||
} | ||
|
||
std::size_t vertexLength = 0; | ||
std::size_t indexLength = 0; | ||
}; | ||
|
||
} // namespace mbgl |
Oops, something went wrong.