diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-11-04 17:12:47 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-11-04 21:24:05 +0100 |
commit | eed16cb1bb14c5de68e71ba7960cbe264cc08760 (patch) | |
tree | 6e43e3d84c170b8bf55742bd0dfdc8022922dbd8 /src/mbgl/renderer | |
parent | 008a83b91584b8cf406264c5378bdd7ef87683ec (diff) | |
download | qtlocation-mapboxgl-eed16cb1bb14c5de68e71ba7960cbe264cc08760.tar.gz |
[core] add state tracking to pixel transfer
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r-- | src/mbgl/renderer/painter_debug.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mbgl/renderer/painter_debug.cpp b/src/mbgl/renderer/painter_debug.cpp index 1db2167b71..bdc0b90bd4 100644 --- a/src/mbgl/renderer/painter_debug.cpp +++ b/src/mbgl/renderer/painter_debug.cpp @@ -73,6 +73,9 @@ void Painter::renderClipMasks(PaintParameters&) { // tightly packed into the buffer to avoid buffer overruns. Also see unpacking adjustment below. context.pixelStorePack = { 1 }; + // Reset the value in case someone else changed it, or it's dirty. + context.pixelTransferStencil = gl::value::PixelTransferStencil::Default; + // Read the stencil buffer const auto viewport = context.viewport.getCurrentValue(); auto pixels = std::make_unique<uint8_t[]>(viewport.size.width * viewport.size.height); @@ -116,9 +119,8 @@ void Painter::renderDepthBuffer(PaintParameters&) { // Scales the values in the depth buffer so that they cover the entire grayscale range. This // makes it easier to spot tiny differences. - const double base = 1.0 / (1.0 - depthRangeSize); - MBGL_CHECK_ERROR(glPixelTransferf(GL_DEPTH_SCALE, base)); - MBGL_CHECK_ERROR(glPixelTransferf(GL_DEPTH_BIAS, 1.0 - base)); + const float base = 1.0f / (1.0f - depthRangeSize); + context.pixelTransferDepth = { base, 1.0f - base }; // Read the stencil buffer auto viewport = context.viewport.getCurrentValue(); |