Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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: 1 addition & 0 deletions platform/android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### 🐞 Bug fixes

- Fix missing depth/stencil render-group state for 3D drawables in layer groups without stencil tiles (previously: Metal rendered without depth, OpenGL discarded all fragments).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add it under a new ## main heading and link the PR.

- fix(core): Update image descriptor sets when removing textures ([#4351](https://github.com/maplibre/maplibre-native/pull/4351)).
- Fix surface snapshot timing ([#4339](https://github.com/maplibre/maplibre-native/pull/4339)).
- core: Fix dynamic texture resource management ([#4337](https://github.com/maplibre/maplibre-native/pull/4337)).
Expand Down
1 change: 1 addition & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MapLibre welcomes participation and contributions from everyone. Please read [`M
## 6.27.0

- Implement ambient cache for PMTiles sources ([#4290](https://github.com/maplibre/maplibre-native/pull/4290)).
- Fix missing depth/stencil render-group state for 3D drawables in layer groups without stencil tiles (previously: Metal rendered without depth, OpenGL discarded all fragments).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add it under a new ## main heading and link the PR.


## 6.26.1

Expand Down
22 changes: 12 additions & 10 deletions src/mbgl/gl/layer_group_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,19 @@ void TileLayerGroupGL::render(RenderOrchestrator&, PaintParameters& parameters)
const auto debugGroupClip = parameters.encoder->createDebugGroup(label_clip.c_str());
#endif

// If we're using stencil clipping, we need to handle 3D features separately
if (stencilTiles && !stencilTiles->empty()) {
visitDrawables([&](const gfx::Drawable& drawable) {
if (drawable.getEnabled() && drawable.getIs3D() && drawable.hasRenderPass(parameters.pass)) {
features3d = true;
if (drawable.getEnableStencil()) {
stencil3d = true;
}
// 3D features need the group-level stencil state: `DrawableGL::draw`
// intentionally skips stencil setup for is3D drawables. Detect them
// even without stencil tiles, otherwise is3D drawables (e.g. custom
// drawable geometry) inherit whatever stencil state the previous layer
// left bound and their fragments get discarded.
visitDrawables([&](const gfx::Drawable& drawable) {
if (drawable.getEnabled() && drawable.getIs3D() && drawable.hasRenderPass(parameters.pass)) {
features3d = true;
if (stencilTiles && !stencilTiles->empty() && drawable.getEnableStencil()) {
stencil3d = true;
}
});
}
}
});

// If we're doing 3D stenciling and have any features
// to draw, set up the single-value stencil mask.
Expand Down
21 changes: 11 additions & 10 deletions src/mbgl/mtl/tile_layer_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@ void TileLayerGroup::render(RenderOrchestrator&, PaintParameters& parameters) {
bool stencil3d = false;
gfx::StencilMode stencilMode3d;

// If we're using stencil clipping, we need to handle 3D features separately
if (stencilTiles && !stencilTiles->empty()) {
visitDrawables([&](const gfx::Drawable& drawable) {
if (drawable.getEnabled() && drawable.getIs3D() && drawable.hasRenderPass(parameters.pass)) {
features3d = true;
if (drawable.getEnableStencil()) {
stencil3d = true;
}
// 3D features need the group-level depth/stencil state: `Drawable::draw`
// intentionally skips depth-stencil setup for is3D drawables. Detect them
// even without stencil tiles, otherwise is3D drawables (e.g. custom
// drawable geometry) render with whatever state happens to be bound.
visitDrawables([&](const gfx::Drawable& drawable) {
if (drawable.getEnabled() && drawable.getIs3D() && drawable.hasRenderPass(parameters.pass)) {
features3d = true;
if (stencilTiles && !stencilTiles->empty() && drawable.getEnableStencil()) {
stencil3d = true;
}
});
}
}
});

#if !defined(NDEBUG)
const auto debugGroupRender = parameters.encoder->createDebugGroup(getName() + "-render");
Expand Down
Loading