summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/program.hpp
Commit message (Collapse)AuthorAgeFilesLines
* [core] Pass correct sources to programIdentifierJohn Firebaugh2017-07-121-10/+6
|
* [core] Rework attribute binding (again)John Firebaugh2017-07-121-13/+13
| | | | | | | | | | 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.
* [core] Include what you useJohn Firebaugh2017-07-121-1/+1
|
* [core] Bind only active attributes in order to avoid exceeding attribute ↵Lauren Budorick2017-06-291-5/+7
| | | | | limits (#9373) Introducing two new attributes to enable property functions for line-width (#9250) pushed the attribute count over GL_MAX_VERTEX_ATTRIBS on some devices. Now we selectively bind only attributes that are used, making it unlikely to surpass GL_MAX_VERTEX_ATTRIBS.
* [core] Dynamic program compilation for data-driven propertiesJohn Firebaugh2017-06-131-6/+5
|
* [core] cleanup ProgramParametersKonstantin Käfer2017-06-131-2/+2
|
* [core] Add DDS support for {text,icon}-size (#8593)Anand Thakker2017-04-061-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | * Update gl-js and generate style code * Factor out packUint8Pair() helper function * Draft implementation of DDS for {text,icon}-size Ports https://github.com/mapbox/mapbox-gl-js/pull/4455 * Fix text-size/composite-function-line-placement test * Refactor to PaintPropertyBinders-like strategy * Dedupe gl::Program construction * Use exponential function base for interpolation * Dedupe coveringZoomStops method * Fixup tests * Fix CI errors (hidden within #if block)
* [core] cache binary shaders on AndroidKonstantin Käfer2017-03-221-7/+23
|
* [core] Add support for data-driven stylingJohn Firebaugh2017-02-021-18/+24
|
* [core] Use indexed rendering everywhereJohn Firebaugh2016-12-011-26/+0
|
* [core] Introduce SegmentVectorJohn Firebaugh2016-11-151-3/+4
|
* [core] Assign attribute locations sequentiallyJohn Firebaugh2016-11-151-1/+1
| | | | | | | 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.
* [core] Use gl::Program to resolve some rough edges in the GL binding typesJohn Firebaugh2016-11-081-3/+61
| | | | | | | | | * 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.
* [core] Introduce gl::Program templateJohn Firebaugh2016-11-081-0/+37