[webkit-changes] [WebKit/WebKit] ca6c34: [TextureMapper] Preserve 3d may split layers unnec...

Jani Hautakangas noreply at github.com
Thu Dec 19 01:08:55 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ca6c3486ddd32d840ebdaee645aa025d93090955
      https://github.com/WebKit/WebKit/commit/ca6c3486ddd32d840ebdaee645aa025d93090955
  Author: Jani Hautakangas <jani at kodegood.com>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/texmap/ClipPath.h
    M Source/WebCore/platform/graphics/texmap/FloatPolygon3D.cpp
    M Source/WebCore/platform/graphics/texmap/FloatPolygon3D.h
    M Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
    M Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.h

  Log Message:
  -----------
  [TextureMapper] Preserve 3d may split layers unnecessarily when they don't intersect
https://bugs.webkit.org/show_bug.cgi?id=284250

Reviewed by Fujii Hironori.

Add preprocessing to conditionally skip BSP tree building for 3D rendering

Introduce a preprocessing step to determine if BSP tree construction can be
bypassed. If the 3D scene lacks intersecting layers or has an unambiguous
rendering order, building the BSP tree is unnecessary. Skipping BSP tree
layer splits enhances performance, especially on devices with slow stencil
performance like RPi3.

This patch implements:
- **Broad Phase:** Sweep-and-prune algorithm to identify potential intersecting layers.
- **Narrow Phase:** Projects potential collision pairs onto the ZY plane for intersection checks.

The ZY projection effectively detects both intersections and ambiguous rendering
orders, ensuring that BSP tree building is only performed when necessary.

* Source/WebCore/platform/graphics/texmap/ClipPath.h:
* Source/WebCore/platform/graphics/texmap/FloatPolygon3D.cpp:
* Source/WebCore/platform/graphics/texmap/FloatPolygon3D.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::computeFlattenedRegion const):
(WebCore::TextureMapperLayer::flattensAsLeafOf3DSceneOr3DPerspective const):
(WebCore::TextureMapperLayer::collect3DRenderingContextLayers):
(WebCore::TextureMapperLayer::effectiveLayerRect const):
(WebCore::TextureMapperLayer::computeFlattenedRegion): Deleted.
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h:
(WebCore::TextureMapperLayer::isLeafOf3DRenderingContext const):
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.cpp:
(WebCore::projectPolygonToZYPlane):
(WebCore::edgeNormal):
(WebCore::projectQuadOnAxis):
(WebCore::quadsIntersect):
(WebCore::TextureMapperLayer3DRenderingContext::paint):
(WebCore::TextureMapperLayer3DRenderingContext::computeBoundingBox):
(WebCore::TextureMapperLayer3DRenderingContext::sweepAndPrune):
(WebCore::TextureMapperLayer3DRenderingContext::buildTree):
(WebCore::TextureMapperLayer3DRenderingContext::traverseTree):
(WebCore::TextureMapperLayer3DRenderingContext::classifyLayer):
(WebCore::TextureMapperLayer3DRenderingContext::classifyPolygon): Deleted.
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.h:

Canonical link: https://commits.webkit.org/288080@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list