Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Pass3D #3077

Merged
merged 1 commit into from
Dec 13, 2024
Merged
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
14 changes: 5 additions & 9 deletions src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ void RenderFillExtrusionLayer::evaluate(const PropertyEvaluationParameters& para
parameters.getCrossfadeParameters(),
unevaluated.evaluate(parameters, previousProperties->evaluated));

passes = (properties->evaluated.get<style::FillExtrusionOpacity>() > 0)
? (RenderPass::Translucent | RenderPass::Pass3D)
: RenderPass::None;
passes = (properties->evaluated.get<style::FillExtrusionOpacity>() > 0) ? RenderPass::Translucent
: RenderPass::None;
properties->renderPasses = mbgl::underlying_type(passes);
evaluatedProperties = std::move(properties);

Expand Down Expand Up @@ -304,15 +303,12 @@ void RenderFillExtrusionLayer::update(gfx::ShaderRegistry& shaders,

const auto& evaluated = static_cast<const FillExtrusionLayerProperties&>(*evaluatedProperties).evaluated;

// `passes` is set to (RenderPass::Translucent | RenderPass::Pass3D), but `render()`
// only runs on the translucent pass, so although our output is 3D, it does not render
// in the "3D pass".
constexpr auto drawPass = RenderPass::Translucent;

stats.drawablesRemoved += tileLayerGroup->removeDrawablesIf([&](gfx::Drawable& drawable) {
// If the render pass has changed or the tile has dropped out of the cover set, remove it.
const auto& tileID = drawable.getTileID();
if (!(drawable.getRenderPass() & passes) || (tileID && !hasRenderTile(*tileID))) {
if (!(drawable.getRenderPass() & drawPass) || (tileID && !hasRenderTile(*tileID))) {
return true;
}
return false;
Expand All @@ -337,7 +333,7 @@ void RenderFillExtrusionLayer::update(gfx::ShaderRegistry& shaders,
for (const RenderTile& tile : *renderTiles) {
const auto& tileID = tile.getOverscaledTileID();

const auto* optRenderData = getRenderDataForPass(tile, passes);
const auto* optRenderData = getRenderDataForPass(tile, drawPass);
if (!optRenderData || !optRenderData->bucket || !optRenderData->bucket->hasData()) {
removeTile(drawPass, tileID);
continue;
Expand All @@ -349,7 +345,7 @@ void RenderFillExtrusionLayer::update(gfx::ShaderRegistry& shaders,
const auto prevBucketID = getRenderTileBucketID(tileID);
if (prevBucketID != util::SimpleIdentity::Empty && prevBucketID != bucket.getID()) {
// This tile was previously set up from a different bucket, drop and re-create any drawables for it.
removeTile(passes, tileID);
removeTile(drawPass, tileID);
}
setRenderTileBucketID(tileID, bucket.getID());

Expand Down
Loading