summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-03 14:05:12 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-12 14:48:22 -0700
commitc61041b44cd9181641db2351f4657cc356300226 (patch)
tree6a5d115c1796a52d4270ca48fbb1a0e1ce3a2ad4 /cmake
parentfedfaa2f6e582e87b190f5d423302f9f95d147d9 (diff)
downloadqtlocation-mapboxgl-c61041b44cd9181641db2351f4657cc356300226.tar.gz
[core] Rework attribute binding (again)
These changes are necessary for programs whose set of active attributes is not fixed at compile time by a template parameter pack, but rather varies based on the generated shader text at runtime. In such cases, the attribute location of a given named attribute may vary between instances of the same Program. Previously, attribute bindings were implicitly associated with a location based on template parameter order, and -1 was used to indicate an inactive attribute. This left us unable to disable the appropriate attribute when it went from active to inactive. Now, the state tracker for bindings explicitly associates locations and state, and an empty optional is used to indicate an inactive attribute. In addition, a gl::VertexArray class is now exposed, allowing more flexibility in the relationship between Programs, Segments, and attribute bindings. In this commit, that relationship does not change, but the subsequent commit adjusts it to match gl-js, reduce rebinds, and work around buggy VAO implementations. VertexArray uses a pimpl idiom in order to support implementations that lack the VAO extension. In that case, all VertexArrays share global binding state, reflecting the platform reality in the absence of VAOs, while still providing a uniform API.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/core-files.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake
index d912392e15..4ebb2a878d 100644
--- a/cmake/core-files.cmake
+++ b/cmake/core-files.cmake
@@ -73,8 +73,6 @@ set(MBGL_CORE_FILES
src/mbgl/gl/program.hpp
src/mbgl/gl/program_binary_extension.hpp
src/mbgl/gl/renderbuffer.hpp
- src/mbgl/gl/segment.cpp
- src/mbgl/gl/segment.hpp
src/mbgl/gl/state.hpp
src/mbgl/gl/stencil_mode.cpp
src/mbgl/gl/stencil_mode.hpp
@@ -84,6 +82,8 @@ set(MBGL_CORE_FILES
src/mbgl/gl/uniform.hpp
src/mbgl/gl/value.cpp
src/mbgl/gl/value.hpp
+ src/mbgl/gl/vertex_array.cpp
+ src/mbgl/gl/vertex_array.hpp
src/mbgl/gl/vertex_array_extension.hpp
src/mbgl/gl/vertex_buffer.hpp
@@ -154,6 +154,8 @@ set(MBGL_CORE_FILES
src/mbgl/programs/programs.hpp
src/mbgl/programs/raster_program.cpp
src/mbgl/programs/raster_program.hpp
+ src/mbgl/programs/segment.cpp
+ src/mbgl/programs/segment.hpp
src/mbgl/programs/symbol_program.cpp
src/mbgl/programs/symbol_program.hpp
src/mbgl/programs/uniforms.hpp
@@ -611,8 +613,8 @@ set(MBGL_CORE_FILES
src/mbgl/util/stopwatch.cpp
src/mbgl/util/stopwatch.hpp
src/mbgl/util/string.cpp
- src/mbgl/util/thread_local.hpp
src/mbgl/util/thread.hpp
+ src/mbgl/util/thread_local.hpp
src/mbgl/util/throttler.cpp
src/mbgl/util/throttler.hpp
src/mbgl/util/tile_coordinate.hpp