Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6f718906cc3a3c3d943ff6997bbb920ec878025c
https://github.com/WebKit/WebKit/commit/6f718906cc3a3c3d943ff6997bbb920ec878025c
Author: Kimmo Kinnunen <[email protected]>
Date: 2025-10-21 (Tue, 21 Oct 2025)
Changed paths:
M Source/JavaScriptCore/API/ObjcRuntimeExtras.h
M Source/WTF/wtf/glib/FileSystemGlib.cpp
M Source/WTF/wtf/text/CString.h
M Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
M Source/WebCore/html/canvas/WebGLProgram.cpp
M Source/WebCore/html/canvas/WebGLProgram.h
M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
M Source/WebCore/platform/graphics/GraphicsContextGL.h
M Source/WebCore/platform/graphics/GraphicsContextGLActiveInfo.h
M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h
M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in
M
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.cpp
M
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h
M Source/WebKit/Scripts/webkit/messages.py
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h
M
Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp
M Tools/Scripts/generate-gpup-webgl
M Tools/TestWebKitAPI/Tests/WTF/CString.cpp
M Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp
M Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitNetworkSession.cpp
Log Message:
-----------
WebGL getUniformLocation, getAttribLocation calls are slow
https://bugs.webkit.org/show_bug.cgi?id=300784
rdar://150998129
Reviewed by Dan Glastonbury.
Calling getUniformLocation, getAttribLocation would need a synchronous
call to GPU process with very little payload work. Instead of repeated
sync calls, call activeUniforms(), activeAttribs() to get the full
uniform and attrib state. This way location getters as well as few other
calls can fetch the data only once.
The data invalidation was already present, invalidate on re-link.
The complexity in uniform location queries are the arrays, which
must be queriable by their base name as well as the full name with [0]
index. The array base names are added to uniform location map and
uniform index map as special case.
Attributes (100 es), vertex shader inputs (300 es) cannot be declared
as arrays, so they do not need the special casing.
Fix CString::toStdString() since it was incorrect. This patch adds
CString(const std::string&) and this lets us add the correct
CString(const std::string&) instead of replicating the toStdString bug
for consistency.
Speeds up
PerformanceTests/Canvas/WebGL-getAttribLocation-getUniformLocation.html
from ~1500 iterations to ~60000.
Speeds up webgl layout test runs.
Tests: Tools/TestWebKitAPI/Tests/WTF/CString.cpp
Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp
* Source/JavaScriptCore/API/ObjcRuntimeExtras.h:
(StringRange::StringRange):
* Source/WTF/wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::currentExecutablePath):
* Source/WTF/wtf/text/CString.h:
(WTF::CString::CString):
(WTF::CString::toStdString const):
* Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
(WebCore::WebGL2RenderingContext::getUniformIndices):
(WebCore::WebGL2RenderingContext::getActiveUniforms):
(WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
* Source/WebCore/html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::linkStatus):
(WebCore::WebGLProgram::activeAttribs):
(WebCore::WebGLProgram::attribLocations):
(WebCore::WebGLProgram::activeUniforms):
(WebCore::WebGLProgram::uniformLocations):
(WebCore::WebGLProgram::uniformIndices):
(WebCore::WebGLProgram::requiredTransformFeedbackBufferCount):
(WebCore::WebGLProgram::increaseLinkCount):
(WebCore::WebGLProgram::getLinkStatus): Deleted.
(WebCore::WebGLProgram::cacheInfoIfNeeded): Deleted.
* Source/WebCore/html/canvas/WebGLProgram.h:
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getActiveAttrib):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::getAttribLocation):
(WebCore::WebGLRenderingContextBase::getProgramParameter):
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getUniformLocation):
(WebCore::WebGLRenderingContextBase::useProgram):
* Source/WebCore/platform/graphics/GraphicsContextGL.h:
* Source/WebCore/platform/graphics/GraphicsContextGLActiveInfo.h:
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::activeAttribs):
(WebCore::GraphicsContextGLANGLE::activeUniforms):
(WebCore::GraphicsContextGLANGLE::getTransformFeedbackVarying):
(WebCore::GraphicsContextGLANGLE::getActiveUniforms): Deleted.
(WebCore::GraphicsContextGLANGLE::getActiveAttrib): Deleted.
(WebCore::GraphicsContextGLANGLE::getActiveUniform): Deleted.
(WebCore::GraphicsContextGLANGLE::getAttribLocation): Deleted.
(WebCore::GraphicsContextGLANGLE::getUniformLocation): Deleted.
(WebCore::GraphicsContextGLANGLE::getUniformIndices): Deleted.
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in:
*
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.cpp:
(WebKit::RemoteGraphicsContextGL::activeAttribs):
(WebKit::RemoteGraphicsContextGL::activeUniforms):
(WebKit::RemoteGraphicsContextGL::getTransformFeedbackVarying):
(WebKit::RemoteGraphicsContextGL::getActiveAttrib): Deleted.
(WebKit::RemoteGraphicsContextGL::getActiveUniform): Deleted.
(WebKit::RemoteGraphicsContextGL::getAttribLocation): Deleted.
(WebKit::RemoteGraphicsContextGL::getUniformLocation): Deleted.
(WebKit::RemoteGraphicsContextGL::getUniformIndices): Deleted.
(WebKit::RemoteGraphicsContextGL::getActiveUniforms): Deleted.
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h:
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:
*
Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp:
(WebKit::RemoteGraphicsContextGLProxy::activeAttribs):
(WebKit::RemoteGraphicsContextGLProxy::activeUniforms):
(WebKit::RemoteGraphicsContextGLProxy::getTransformFeedbackVarying):
(WebKit::RemoteGraphicsContextGLProxy::getActiveAttrib): Deleted.
(WebKit::RemoteGraphicsContextGLProxy::getActiveUniform): Deleted.
(WebKit::RemoteGraphicsContextGLProxy::getAttribLocation): Deleted.
(WebKit::RemoteGraphicsContextGLProxy::getUniformLocation): Deleted.
(WebKit::RemoteGraphicsContextGLProxy::getUniformIndices): Deleted.
(WebKit::RemoteGraphicsContextGLProxy::getActiveUniforms): Deleted.
* Tools/Scripts/generate-gpup-webgl:
(main):
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringNullStringConstructor)):
(TEST(WTF, CStringEmptyRegularConstructor)):
(TEST(WTF, CStringZeroTerminated)):
(TEST(WTF, CStringStdStringInterop)):
* Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp:
(TestWebKitAPI::TEST(CBORWriterTest, TestWriteUint)):
(TestWebKitAPI::TEST(CBORWriterTest, TestWriteNegativeInteger)):
Canonical link: https://commits.webkit.org/301863@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes