Commit Graph

61 Commits

Author SHA1 Message Date
Ivo van Dongen
1f73c9999e [core] blacklist vao usage on mali t720 (sapphire 650)
Avoids problems on (amongst others) Samsung Galaxy J3
2018-03-01 12:21:32 +01:00
Vladimir Agafonkin
82de856c94 [core, ios, macos, android, node] Heatmap layer (#11046)
Co-Authored-By: Konstantin Käfer <mail@kkaefer.com>
Co-Authored-By: Anand Thakker <anandthakker@users.noreply.github.com>
Co-Authored-By: Minh Nguyễn <1ec5@users.noreply.github.com>
2018-02-15 17:38:23 +02:00
Tobrun
e2a4dffcb6 [android] - blacklist adreno 2xx for VAO support 2018-01-31 12:58:22 +01:00
Konstantin Käfer
145a0ee6d0 [core] blacklist binary program loading for Vivante GC4000 GPUs 2018-01-09 09:55:05 -08:00
Chris Loer
9a5b2fdfc3 [core] Enable dynamic updates of index buffers. 2017-11-17 10:05:15 -08:00
Bruno de Oliveira Abinader
13ec2cc562 Revert "[core] Expose ColorMask in gl::Context::clear()"
This reverts commit e350ef37fe.
2017-11-02 15:14:37 +02:00
Bruno de Oliveira Abinader
e350ef37fe [core] Expose ColorMask in gl::Context::clear() 2017-11-01 17:45:37 +02:00
Ivo van Dongen
45dc313009 [core] blacklist VAO usage on adreno 3xx
- Causes crashes on usage of glBuffer(Sub)Data
2017-10-26 12:00:11 +02:00
Ivo van Dongen
6211db6968 [core] allow context to be abandoned on destruction
- This enables the use case where the system already destroyed the underlying GL resources. Otherwise, the cleanup would fail and crash
2017-09-22 23:33:56 +03:00
Lauren Budorick
a9ddf5b7fd Preserve depth buffer between 3D layers + optimize render order (#9931)
Port of https://github.com/mapbox/mapbox-gl-js/pull/5101: adds a new render pass `Pass3D` before any other rendering wherein we render layers with 3D passes (fill-extrusion layers) to offscreen framebuffers, sharing a depth renderbuffer between those layers in order to render 3D space correctly. Those framebuffers are saved on the RenderLayers and copied back to the map during the translucent pass. Rendering to offscreen framebuffers before we do any clear + draw means we can avoid expensive framebuffer restores.
2017-09-21 14:26:48 -07:00
John Firebaugh
2bbde6903a [core] Rename for clarity: ActiveTexture → ActiveTextureUnit 2017-09-11 10:17:54 -07:00
John Firebaugh
437f243d65 [core] Dirty the correct state when a texture is deleted
When a texture is deleted, it is as if all texture units to which that texture object is bound are rebound to texture object zero. Therefore it's the *bindings* that need to be dirtied, not the active texture unit.
2017-09-11 10:17:54 -07:00
John Firebaugh
d4cb498d7a [all] Merge View into RendererBackend 2017-07-26 09:50:38 -07:00
John Firebaugh
cebc3c8d4b [android] Disable program caching on Adreno 3xx, 4xx, and 5xx GPUs due to known bugs 2017-07-21 09:31:16 -07:00
John Firebaugh
fb8d40ae67 [core] Work around Adreno 2xx GPU bugs (#9573) 2017-07-21 10:17:50 +02:00
John Firebaugh
4c42132183 [core] Reduce memory requirements of VertexArrays 2017-07-12 14:55:02 -07:00
John Firebaugh
c61041b44c [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.
2017-07-12 14:48:22 -07:00
Ansis Brammanis
eac297185d [core] add static asserts for more gl constants
and rename BufferUsageType to BufferUsage
2017-07-11 09:10:25 -07:00
Ansis Brammanis
e514138b69 [core] improve legibility of labels that follow lines
port https://github.com/mapbox/mapbox-gl-js/pull/4781

This improves legibility of labels that follow lines in pitched views.
The previous approach used the limited information in the shader to
calculate put the glyph in approximatelyright place. The new approach
does this more accurately by doing it on the cpu where we have access to
the entire line geometry.
2017-07-11 09:10:24 -07:00
John Firebaugh
92252849c1 [core] Per-bucket glyph atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
b201a7900f [core] glPixelStorei is in OpenGL ES 2 2017-06-13 10:18:43 -07:00
Bruno de Oliveira Abinader
a05f060153 [core] Added Backend::{assume,set}ScissorTest 2017-06-13 13:37:41 +03:00
Bruno de Oliveira Abinader
fa36110dfb [tidy] modernize-use-auto 2017-05-12 18:07:36 +03:00
Konstantin Käfer
fd104dd3c2 [core] Throw exceptions by value 2017-05-05 14:42:47 +02:00
Lauren Budorick
f6e79d7073 [core] Render fill-extrusion layers (#8431) 2017-04-27 15:56:55 -07:00
Bruno de Oliveira Abinader
83d22a5bd4 [core] Value stored to 'format' is never read in Context::drawPixels
Captured via clang-analyzer-deadcode.DeadStores.
2017-03-31 15:51:40 +03:00
Konstantin Käfer
e67abfbe67 [core] Refactor OpenGL extension loading mechanism
Previously, we initialized global variables that held pointers to the extension functions. While this seemed to work, the spec doesn't guarantee that the function pointers are identical for different OpenGL contexts. Therefore, we are now making them a member variable of the Context object.
2017-03-23 14:50:11 -07:00
Konstantin Käfer
3c91b6b7de [core] cache binary shaders on Android 2017-03-22 15:59:10 +01:00
John Firebaugh
4e752f63b9 [core] Redo approach to unsupported VAO extension 2017-02-20 08:24:42 -08:00
John Firebaugh
0bbc6b814c [core] Restore support for GL implementations without VAO extension 2017-02-10 18:04:45 -06:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
John Firebaugh
c12b52c6a7 [core] Fix debug rendering
* Off-by-one in DebugBucket indexing
* Must unbind VAO before binding index buffer in Context::createIndexBuffer
2016-12-13 09:42:46 -08:00
John Firebaugh
54c557d982 [core] Use indexed rendering everywhere 2016-12-01 08:57:11 -08:00
Konstantin Käfer
e76de05402 [build] move logging to util 2016-11-22 20:58:51 +01:00
John Firebaugh
9d2be04461 [core] Return to static, per-segment approach to VAOs
This is safer now -- it can be an implementation detail of Segment/Context. And the typing of SegmentVector now ensures that the attributes and program match.
2016-11-15 13:55:08 -08:00
John Firebaugh
58877d1b3d [core] Assign attribute locations sequentially
Two reasons to prefer explicit sequential location assignment, rather than relying on the GLSL linker to assign locations:

* For data-driven properties, we want to have the option to use glDisableVertexAttribArray plus glVertexAttrib*. In order to use glDisableVertexAttribArray, we must avoid using attribute location 0, which cannot be disabled.
* We want to use the same VAO in cases where, say, a fill layer might be rendered with FillProgram at first, and then FillPatternProgram later. VAOs do not store the program binding, only the attribute bindings, so as long as the two programs have the same attributes and attribute locations, only a single VAO (per segment) is needed.
2016-11-15 13:55:08 -08:00
John Firebaugh
1db2ffbc1b [core] Use gl::Program to resolve some rough edges in the GL binding types
* Extract `ignore` util to separate header.
* `Segment` now tracks offset and length of indices, rather than primitives. This is more natural.
* Introduce `VertexVector` and `IndexVector` types. These types carry information about the intended draw mode (`Triangles`, `LineStrip`, etc.), and ensure that elements are always appended in a group size appropriate for that draw mode, for both indexed and unindexed rendering.
* `Program`, rather than `Drawable`, is now the unifying object for draw calls. `Program` is the best place to type check the draw call, because it is typed to carry information about the intended primitive, vertex type, attributes, and uniforms.
* Use the debug shaders for debug tile rendering, like gl-js.
* Fix the draw mode for background. It was drawing triangle strips with a triangles array. Surprised this didn’t cause issues. Now it’s type checked.
2016-11-08 08:09:29 -08:00
John Firebaugh
66bdbc3b96 [core] Introduce gl::Program template 2016-11-08 08:09:29 -08:00
John Firebaugh
36210fe4e9 [core] Make attribute binding more similar to uniform binding 2016-11-08 08:09:28 -08:00
Konstantin Käfer
7b772611d5 [core] move pixel blitting to gl::Context 2016-11-04 21:24:05 +01:00
Konstantin Käfer
c90a559599 [core] move framebuffer reading to gl::Context 2016-11-04 21:24:05 +01:00
Konstantin Käfer
eed16cb1bb [core] add state tracking to pixel transfer 2016-11-04 21:24:05 +01:00
Konstantin Käfer
008a83b915 [core] add state tracking to pixel store packing alignment 2016-11-04 21:24:05 +01:00
Konstantin Käfer
ed155460d3 [core] convert LineAtlas to use managed texture handling 2016-11-01 18:41:52 +01:00
Konstantin Käfer
358701f475 [core] add ability to upload alpha-only textures + images 2016-11-01 18:41:52 +01:00
Konstantin Käfer
9e3839781f [core] convert SpriteAtlas to use managed texture handling 2016-11-01 18:41:52 +01:00
John Firebaugh
39d5cb3250 [core] Use VAOs internally 2016-10-28 17:14:07 -07:00
John Firebaugh
0e57d10d77 [core] Modern C++ bindings for OpenGL 2016-10-28 17:14:01 -07:00
Konstantin Käfer
62b56b799a [core] change std::array<uint16_t, 2> to mbgl::Size 2016-10-27 18:30:58 -07:00
Konstantin Käfer
a4d259c33f [core] move gl::Context to Backend and refactor View 2016-10-25 13:52:36 -07:00