[webkit-changes] [WebKit/WebKit] 3440db: [TextureMapper] Polygon clipping performance is ex...
Jani Hautakangas
noreply at github.com
Sun Dec 8 13:07:42 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3440db247780d0361df3c48b07059f57ca86e92b
https://github.com/WebKit/WebKit/commit/3440db247780d0361df3c48b07059f57ca86e92b
Author: Jani Hautakangas <jani at kodegood.com>
Date: 2024-12-08 (Sun, 08 Dec 2024)
Changed paths:
M Source/WebCore/platform/TextureMapper.cmake
A Source/WebCore/platform/graphics/texmap/ClipPath.cpp
A Source/WebCore/platform/graphics/texmap/ClipPath.h
M Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
M Source/WebCore/platform/graphics/texmap/TextureMapper.h
A Source/WebCore/platform/graphics/texmap/TextureMapperGPUBuffer.cpp
A Source/WebCore/platform/graphics/texmap/TextureMapperGPUBuffer.h
M Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
M Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.cpp
M Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.h
Log Message:
-----------
[TextureMapper] Polygon clipping performance is extremely slow
https://bugs.webkit.org/show_bug.cgi?id=284027
Reviewed by Fujii Hironori.
Rendering complex preserve-3D scenes might involve a lot of layer splitting.
These splits are handled using polygon clipping, but the current implementation
is inefficient. Each clip operation clears the full stencil buffer and masks
the clipped part using separate vertex buffer objects that are allocated on
demand. This places significant stress on the GPU and on hardware like rpi3 it
completely chokes the rendering pipeline.
To address this issue, polygon clip vertices for preserve-3d scenes should be
loaded to the GPU only once, leveraging cached VBOs. Additionally, stencil
buffer clearing should be optimized using scissors to restrict stencil clears to
relevant areas, avoiding full-buffer operations.
* Source/WebCore/platform/TextureMapper.cmake:
* Source/WebCore/platform/graphics/texmap/ClipPath.cpp: Added.
(WebCore::ClipPath::ClipPath):
(WebCore::ClipPath::data const):
* Source/WebCore/platform/graphics/texmap/ClipPath.h: Added.
* Source/WebCore/platform/graphics/texmap/TextureMapper.cpp:
(WebCore::nextPowerOf2):
(WebCore::TextureMapperGLData::initializeStencil):
(WebCore::TextureMapperGLData::getBufferFromPool):
(WebCore::TextureMapper::beginClip):
(WebCore::TextureMapper::updateProjectionMatrix):
(WebCore::TextureMapper::acquireBufferFromPool):
* Source/WebCore/platform/graphics/texmap/TextureMapper.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperGPUBuffer.cpp: Added.
(WebCore::TextureMapperGPUBuffer::TextureMapperGPUBuffer):
(WebCore::TextureMapperGPUBuffer::~TextureMapperGPUBuffer):
(WebCore::TextureMapperGPUBuffer::updateData):
* Source/WebCore/platform/graphics/texmap/TextureMapperGPUBuffer.h: Added.
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintWith3DRenderingContext):
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.cpp:
(WebCore::TextureMapperLayer3DRenderingContext::paint):
(WebCore::TextureMapperLayer3DRenderingContext::traverseTree):
(WebCore::TextureMapperLayer3DRenderingContext::traverseTreeAndPaint): Deleted.
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer3DRenderingContext.h:
Canonical link: https://commits.webkit.org/287519@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