Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Fix symbol rendering under opaque fill layers #14839

Merged
merged 1 commit into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion platform/node/test/ignores.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
"render-tests/feature-state/composite-expression": "https://github.com/mapbox/mapbox-gl-native/issues/12613",
"render-tests/feature-state/data-expression": "https://github.com/mapbox/mapbox-gl-native/issues/12613",
"render-tests/feature-state/vector-source": "https://github.com/mapbox/mapbox-gl-native/issues/12613",
"render-tests/fill-opacity/opaque-fill-over-symbol-layer": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/7612",
"render-tests/text-variable-anchor/pitched-rotated-debug": "https://github.com/mapbox/mapbox-gl-native/issues/14211",
"render-tests/text-variable-anchor/rotated-offset": "https://github.com/mapbox/mapbox-gl-native/issues/14211",
"render-tests/text-variable-anchor/remember-last-placement": "skip - fails on gl-native, as symbol index is not functional at static map mode - needs issue",
Expand Down
14 changes: 2 additions & 12 deletions src/mbgl/renderer/layers/render_symbol_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ void drawIcon(const DrawFn& draw,
bucket.icon,
iconSegments,
bucket.iconSizeBinder,
values,
bucketPaintProperties.iconBinders,
paintPropertyValues,
SymbolSDFIconProgram::TextureBindings{
Expand All @@ -154,7 +153,6 @@ void drawIcon(const DrawFn& draw,
bucket.icon,
iconSegments,
bucket.iconSizeBinder,
values,
bucketPaintProperties.iconBinders,
paintPropertyValues,
SymbolSDFIconProgram::TextureBindings{
Expand All @@ -168,7 +166,6 @@ void drawIcon(const DrawFn& draw,
bucket.icon,
iconSegments,
bucket.iconSizeBinder,
values,
bucketPaintProperties.iconBinders,
paintPropertyValues,
SymbolIconProgram::TextureBindings{
Expand Down Expand Up @@ -206,7 +203,6 @@ void drawText(const DrawFn& draw,
bucket.text,
textSegments,
bucket.textSizeBinder,
values,
bucketPaintProperties.textBinders,
paintPropertyValues,
SymbolSDFTextProgram::TextureBindings{
Expand All @@ -221,7 +217,6 @@ void drawText(const DrawFn& draw,
bucket.text,
textSegments,
bucket.textSizeBinder,
values,
bucketPaintProperties.textBinders,
paintPropertyValues,
SymbolSDFTextProgram::TextureBindings{
Expand Down Expand Up @@ -293,7 +288,6 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
const auto& buffers,
auto& segments,
const auto& symbolSizeBinder,
const SymbolPropertyValues& values_,
const auto& binders,
const auto& paintProperties,
const auto& textureBindings,
Expand Down Expand Up @@ -322,9 +316,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
parameters.context,
*parameters.renderPass,
gfx::Triangles(),
values_.pitchAlignment == AlignmentType::Map
? parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly)
: gfx::DepthMode::disabled(),
parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
gfx::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gfx::CullFaceMode::disabled(),
Expand All @@ -341,9 +333,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) {
parameters.context,
*parameters.renderPass,
gfx::Triangles(),
values_.pitchAlignment == AlignmentType::Map
? parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly)
: gfx::DepthMode::disabled(),
parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
gfx::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gfx::CullFaceMode::disabled(),
Expand Down
5 changes: 2 additions & 3 deletions src/mbgl/renderer/paint_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ mat4 PaintParameters::matrixForTile(const UnwrappedTileID& tileID, bool aligned)
}

gfx::DepthMode PaintParameters::depthModeForSublayer(uint8_t n, gfx::DepthMaskType mask) const {
float nearDepth = ((1 + currentLayer) * numSublayers + n) * depthEpsilon;
float farDepth = nearDepth + depthRangeSize;
return gfx::DepthMode { gfx::DepthFunctionType::LessEqual, mask, { nearDepth, farDepth } };
float depth = depthRangeSize + ((1 + currentLayer) * numSublayers + n) * depthEpsilon;
return gfx::DepthMode { gfx::DepthFunctionType::LessEqual, mask, { depth, depth } };
}

gfx::DepthMode PaintParameters::depthModeFor3D() const {
Expand Down