diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-08-23 01:05:26 +0300 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2018-09-13 08:42:36 +0300 |
commit | 05a7b78aa866720245022805410aae92bb887fa6 (patch) | |
tree | 1979e724d148cdb9c3a9fe2aac80f718a41c65b5 /src/mbgl/gl/context.cpp | |
parent | e4e43bb54fbc519464083300aef295abc4ee095b (diff) | |
download | qtlocation-mapboxgl-05a7b78aa866720245022805410aae92bb887fa6.tar.gz |
[core] Add face culling mode parameter to Program::draw
Add a parameter to Program::draw to control whether face culling should
be enabled. This will be used in a follow up commit to enable face
culling for fill extrusion layers.
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r-- | src/mbgl/gl/context.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 4afbe5af1e..22b22b549d 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -617,6 +617,9 @@ void Context::setDirtyState() { clearDepth.setDirty(); clearColor.setDirty(); clearStencil.setDirty(); + cullFace.setDirty(); + cullFaceSide.setDirty(); + frontFace.setDirty(); program.setDirty(); lineWidth.setDirty(); activeTextureUnit.setDirty(); @@ -663,6 +666,16 @@ void Context::clear(optional<mbgl::Color> color, MBGL_CHECK_ERROR(glClear(mask)); } +void Context::setCullFaceMode(const CullFaceMode& mode) { + cullFace = mode.cullFace; + + // These shouldn't need to be updated when face culling is disabled, but we + // might end up having the same isssues with Adreno 2xx GPUs as noted in + // Context::setDepthMode. + cullFaceSide = mode.side; + frontFace = mode.frontFace; +} + #if not MBGL_USE_GLES2 void Context::setDrawMode(const Points& points) { pointSize = points.pointSize; |